-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
35 lines (29 loc) · 784 Bytes
/
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
trigger:
branches:
include:
- main
- develop
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- script: |
sed -i -e "s/\(\"version\":\\s\+\"\([0-9]\+\.\?\)\+\)/\1-pre.$BUILD_BUILDNUMBER/" package.json;
displayName: 'Preview version'
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
- script: |
npm pack
displayName: 'npm pack'
- task: Npm@1
inputs:
command: publish
publishEndpoint: 'NPM connection 1'
displayName: 'Publish package'
condition: and(succeeded(), in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/develop'))