forked from microsoft/azure-devops-node-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
44 lines (38 loc) · 1.03 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
pool:
vmImage: ubuntu-18.04
strategy:
matrix:
'Node 6':
versionSpec: '6.x'
'Node 8':
versionSpec: '8.x'
'Node 10':
versionSpec: '10.x'
'Node 12':
versionSpec: '12.x'
'Node 14':
versionSpec: '14.x'
'Node 16':
versionSpec: '16.x'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(versionSpec)
displayName: Install node
# install dependencies
- script: npm install
displayName: npm install
# build
- script: npm run build
displayName: npm run build
- script: npm run units
displayName: Run unit tests
# For CI runs on master, automatically publish packages
- bash: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
cd _build
npm publish || true # Ignore publish failures, usually will happen because package already exists
displayName: npm publish
condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), eq(variables['build.sourcebranchname'], 'master'))
env:
NPM_TOKEN: $(npmPublishToken)