Skip to content

Commit e247d17

Browse files
Implement pipeline to publish TFX CLI automatically (#435)
1 parent 59d2330 commit e247d17

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.azure-pipelines/azure-pipeline.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
trigger:
2+
- master
3+
4+
pool:
5+
vmImage: windows-latest
6+
7+
variables:
8+
- group: npm-tokens
9+
10+
steps:
11+
- checkout: self
12+
clean: true
13+
14+
- task: NodeTool@0
15+
displayName: Use node 10
16+
inputs:
17+
versionSpec: "10.x"
18+
19+
- script: npm i -g npm@6.14.12 --force
20+
displayName: Use npm version 6.14.12
21+
22+
- script: npm ci
23+
displayName: Install npm-dependencies
24+
25+
- script: npm run build
26+
displayName: Build TFX CLI
27+
28+
- powershell: |
29+
"//registry.npmjs.org/:_authToken=$env:NPM_TOKEN" | Out-File ".npmrc"
30+
& npm publish --ignore-scripts _build
31+
if ($LASTEXITCODE -eq 1) {
32+
Write-Host "##vso[task.logissue type=warning]Publishing TFX CLI was unsuccessful"
33+
exit 0
34+
}
35+
env:
36+
NPM_TOKEN: $(npm-automation.token)
37+
displayName: Publish TFX CLI

0 commit comments

Comments
 (0)