-
Notifications
You must be signed in to change notification settings - Fork 240
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
49 lines (42 loc) · 1.22 KB
/
azure-pipelines.yml
File metadata and controls
49 lines (42 loc) · 1.22 KB
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
45
46
47
48
49
pool:
vmImage: ubuntu-20.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
- script: npm run lint
displayName: Run lint (ESlint)
# Only perform linting for Higher than Node 12
condition: and(succeeded(), eq(variables['versionSpec'], '12.x', '14.x', '16.x'))
# 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)