-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
78 lines (73 loc) · 1.91 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
variables:
- group: semantic-release
trigger:
- master
pr:
- master
jobs:
- job: commitlint
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: 18.x
displayName: Use Node.js 18
- script: npm ci
displayName: Install Dependencies
- script: npm run build
displayName: Build
- script: |
chmod a+x ./bin/run
./bin/run
workingDirectory: $(Build.SourcesDirectory)
displayName: Lint Commits
- job: Test
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: 18.x
displayName: Use Node.js 18
- script: npm ci
displayName: Install Dependencies
- script: npm test
displayName: Run Tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: junit.xml
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: coverage/cobertura-coverage.xml
reportDirectory: coverage
- job: publish
dependsOn:
- commitlint
- test
pool:
vmImage: 'ubuntu-latest'
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual', 'IndividualCI', 'BatchedCI'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
steps:
- task: NodeTool@0
inputs:
versionSpec: 18.x
displayName: Use Node.js 18
- script: npm ci
displayName: Install Dependencies
- script: npm run release
env:
GH_TOKEN: $(GH_TOKEN)
NPM_TOKEN: $(NPM_TOKEN)
displayName: Publish to NPM