|
20 | 20 | - "*"
|
21 | 21 |
|
22 | 22 | pool:
|
23 |
| - vmImage: 'ubuntu-latest' |
| 23 | + vmImage: "ubuntu-latest" |
24 | 24 |
|
25 | 25 | variables:
|
26 |
| - node_version: '18' |
27 |
| - pnpm_version: '9.0.0' |
28 |
| - workingDirectory: 'ts' |
29 |
| - agentsdk_folder: 'ts/packages/agentSdk' |
30 |
| - |
| 26 | + workingDirectory: "ts" |
| 27 | + agentsdk_folder: "ts/packages/agentSdk" |
| 28 | + |
31 | 29 | jobs:
|
32 |
| -- job: build_ts |
33 |
| - displayName: 'Build TypeScript Project' |
34 |
| - strategy: |
35 |
| - matrix: |
36 |
| - node_20: |
37 |
| - nodeVersion: '20' |
38 |
| - steps: |
39 |
| - - checkout: TypeAgent-GH |
40 |
| - displayName: 'Checkout TypeAgent Repository' |
41 |
| - path: 'typeagent' |
42 |
| - |
43 |
| - - template: include-install-pnpm.yml |
44 |
| - parameters: |
45 |
| - buildDirectory: $(Build.SourcesDirectory)/ts |
46 |
| - |
47 |
| - - script: | |
48 |
| - curl -fsSL https://get.pnpm.io/v6.14.js | node - add --global pnpm@$(pnpm_version) |
49 |
| - export PNPM_HOME="$HOME/.local/share/pnpm" |
50 |
| - export PATH="$PNPM_HOME:$PATH" |
51 |
| - displayName: 'Install pnpm' |
52 |
| - condition: always() |
53 |
| -
|
54 |
| - - task: UseNode@1 |
55 |
| - displayName: 'Setup Node.js' |
56 |
| - inputs: |
57 |
| - version: $(nodeVersion) |
58 |
| - checkLatest: true |
59 |
| - |
60 |
| - - script: | |
61 |
| - pnpm install --frozen-lockfile --strict-peer-dependencies |
62 |
| - displayName: 'Install dependencies' |
63 |
| - workingDirectory: $(workingDirectory) |
64 |
| -
|
65 |
| - - script: | |
66 |
| - current_version=$(node -p "require('./package.json').version") |
67 |
| - new_version="${current_version}-$(Build.BuildId)" |
68 |
| - echo "##vso[task.setvariable variable=package_version]$new_version" |
69 |
| - jq ".version=\"$new_version\"" package.json > package.tmp.json |
70 |
| - mv package.tmp.json package.json |
71 |
| - echo "Updated package.json to version $new_version" |
72 |
| - cat package.json |
73 |
| - displayName: 'Update Package Version' |
74 |
| - workingDirectory: $(agentsdk_folder) |
75 |
| -
|
76 |
| - - script: | |
77 |
| - npm run build |
78 |
| - displayName: 'Build' |
79 |
| - workingDirectory: $(workingDirectory) |
80 |
| -
|
81 |
| - - script: | |
82 |
| - npm run test |
83 |
| - displayName: 'Run Tests' |
84 |
| - workingDirectory: $(workingDirectory) |
85 |
| -
|
86 |
| - - script: | |
87 |
| - npm run lint |
88 |
| - displayName: 'Lint' |
89 |
| - workingDirectory: $(workingDirectory) |
90 |
| -
|
91 |
| - - script: | |
92 |
| - echo $(ADO_REGISTRY) |
93 |
| - echo "registry=$(ADO_REGISTRY)" > .npmrc |
94 |
| - echo "always-auth=true" >> .npmrc |
95 |
| - cat .npmrc |
96 |
| - displayName: 'Create .npmrc file.' |
97 |
| - workingDirectory: $(agentsdk_folder) |
98 |
| -
|
99 |
| - - task: npmAuthenticate@0 |
100 |
| - inputs: |
101 |
| - workingFile: '$(agentsdk_folder)/.npmrc' |
102 |
| - displayName: 'Authenticate with Azure Artifacts' |
103 |
| - |
104 |
| - - script: | |
105 |
| - cd $(Build.SourcesDirectory)/$(agentsdk_folder) |
106 |
| - npm publish --registry=$(ADO_REGISTRY) |
107 |
| - displayName: 'Pack and Publish agent-sdk Module' |
108 |
| - condition: succeeded() |
| 30 | + - job: build_ts |
| 31 | + displayName: "Build TypeScript Project" |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + node_20: |
| 35 | + nodeVersion: "22" |
| 36 | + steps: |
| 37 | + - checkout: TypeAgent-GH |
| 38 | + displayName: "Checkout TypeAgent Repository" |
| 39 | + path: "typeagent" |
| 40 | + |
| 41 | + - template: include-install-pnpm.yml |
| 42 | + parameters: |
| 43 | + buildDirectory: $(Build.SourcesDirectory)/ts |
| 44 | + |
| 45 | + - task: UseNode@1 |
| 46 | + displayName: "Setup Node.js" |
| 47 | + inputs: |
| 48 | + version: $(nodeVersion) |
| 49 | + checkLatest: true |
| 50 | + |
| 51 | + - script: | |
| 52 | + pnpm install --frozen-lockfile --strict-peer-dependencies |
| 53 | + displayName: "Install dependencies" |
| 54 | + workingDirectory: $(workingDirectory) |
| 55 | +
|
| 56 | + - script: | |
| 57 | + current_version=$(node -p "require('./package.json').version") |
| 58 | + new_version="${current_version}-$(Build.BuildId)" |
| 59 | + echo "##vso[task.setvariable variable=package_version]$new_version" |
| 60 | + jq ".version=\"$new_version\"" package.json > package.tmp.json |
| 61 | + mv package.tmp.json package.json |
| 62 | + echo "Updated package.json to version $new_version" |
| 63 | + cat package.json |
| 64 | + displayName: "Update Package Version" |
| 65 | + workingDirectory: $(agentsdk_folder) |
| 66 | +
|
| 67 | + - script: | |
| 68 | + npm run build |
| 69 | + displayName: "Build" |
| 70 | + workingDirectory: $(workingDirectory) |
| 71 | +
|
| 72 | + - script: | |
| 73 | + npm run test |
| 74 | + displayName: "Run Tests" |
| 75 | + workingDirectory: $(workingDirectory) |
| 76 | +
|
| 77 | + - script: | |
| 78 | + npm run lint |
| 79 | + displayName: "Lint" |
| 80 | + workingDirectory: $(workingDirectory) |
| 81 | +
|
| 82 | + - script: | |
| 83 | + echo $(ADO_REGISTRY) |
| 84 | + echo "registry=$(ADO_REGISTRY)" > .npmrc |
| 85 | + echo "always-auth=true" >> .npmrc |
| 86 | + cat .npmrc |
| 87 | + displayName: "Create .npmrc file." |
| 88 | + workingDirectory: $(agentsdk_folder) |
| 89 | +
|
| 90 | + - task: npmAuthenticate@0 |
| 91 | + inputs: |
| 92 | + workingFile: "$(agentsdk_folder)/.npmrc" |
| 93 | + displayName: "Authenticate with Azure Artifacts" |
| 94 | + |
| 95 | + - script: | |
| 96 | + cd $(Build.SourcesDirectory)/$(agentsdk_folder) |
| 97 | + npm publish --registry=$(ADO_REGISTRY) |
| 98 | + displayName: "Pack and Publish agent-sdk Module" |
| 99 | + condition: succeeded() |
0 commit comments