-
Notifications
You must be signed in to change notification settings - Fork 0
/
.az.yml
106 lines (92 loc) · 2.27 KB
/
.az.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
trigger:
branches:
include:
- master
- develop
- feature*
- hotfix*
- bug*
- release*
pool:
vmImage: 'ubuntu-latest'
variables:
- group: coveralls orc-scripts
- group: npm publish token
steps:
- task: NodeTool@0
displayName: 'Use Node 18.x'
inputs:
versionSpec: 18.x
- task: Npm@0
displayName: 'npm install'
inputs:
command: 'install'
arguments: '--verbose'
- task: PublishBuildArtifacts@1
displayName: 'Publish eresolve-report.txt'
condition: failed()
continueOnError: true
inputs:
PathtoPublish: 'C:\npm\cache\eresolve-report.txt'
ArtifactName: 'NpmInstallLog'
- task: Npm@1
displayName: 'npm prune'
inputs:
command: 'custom'
customCommand: 'prune'
- task: Npm@1
displayName: 'npm ls --depth=1'
continueOnError: true
inputs:
command: 'custom'
customCommand: 'ls --depth=1'
- task: Npm@1
displayName: 'npm run lint'
inputs:
command: 'custom'
customCommand: 'run lint -- --max-warnings 0'
- task: Npm@1
displayName: 'npm run coverage'
inputs:
command: 'custom'
customCommand: 'run coverage'
- task: Npm@1
displayName: 'npm run coveralls'
inputs:
command: 'custom'
customCommand: 'run coveralls'
env:
CI_NAME: 'Azure DevOps orc-scripts'
CI_BUILD_NUMBER: $(Build.BuildNumber)
CI_BUILD_URL: $(Build.Repository.Uri)
CI_BRANCH: $(Build.SourceBranch)
COVERALLS_REPO_TOKEN: $(CoverallsToken)
- task: Bash@3
displayName: 'Detect NPM tag'
inputs:
targetType: 'inline'
script: |
NPM_TAG=`node src getDist`
echo "##vso[task.setvariable variable=NpmTag]$NPM_TAG"
- task: Bash@3
displayName: 'Detect if we need to publish packages'
inputs:
targetType: 'inline'
script: |
git describe --exact-match --tags HEAD
echo "##vso[task.setvariable variable=CanUploadNpmPackage]$?"
- task: Bash@3
displayName: 'Configure .npmrc with NPM_TOKEN config'
inputs:
targetType: 'inline'
script: |
echo -e "\r\n//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc
cat .npmrc
- task: Npm@1
displayName: 'npm publish'
condition: and(succeeded(), eq(variables['CanUploadNpmPackage'], '0'))
inputs:
command: 'custom'
customCommand: 'publish --tag $(NpmTag)'
env:
NPM_TOKEN: $(NpmPublishToken)