-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.template.yml
54 lines (44 loc) · 1.36 KB
/
azure-pipelines.template.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
parameters:
- name: buildPostfix
type: string
default: ""
- name: additionalCommandArgs
type: string
default: ""
- name: baseUri
type: string
default: ""
- name: setGitTag
type: boolean
default: false
steps:
- checkout: self
persistCredentials: true
- task: NodeTool@0.200.0
inputs:
versionSpec: "18.x"
displayName: "Use node"
- script: npm install -g npm@8.12
displayName: "Use NPM"
- script: npm ci
displayName: "Install dependencies"
- script: npm run build
displayName: "Run build"
- script: npm run coverage
displayName: "Run tests"
- task: PublishTestResults@2.203.0
inputs:
testResultsFiles: "**/test-*.xml"
- task: PublishCodeCoverageResults@1.200.0
inputs:
codeCoverageTool: "Cobertura"
summaryFileLocation: "**/cobertura-coverage.xml"
- script: |
npm run publish-extension${{ parameters.buildPostfix }} -- -t "$(PUBLISH_TOKEN)" --override '{"version":"$(version)","baseUri":"${{ parameters.baseUri }}"}' ${{ parameters.additionalCommandArgs }}
displayName: "Publish extension"
condition: and(succeeded(), eq(variables.isDependabot, 'false'))
- script: |
git tag $(version)
git push origin $(version)
workingDirectory: $(Build.SourcesDirectory)
condition: and(succeeded(), eq('${{ parameters.setGitTag }}', 'true'))