-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
50 lines (42 loc) · 1.34 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
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
branches:
include:
- master
- develop
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
npm run test
displayName: 'npm install, build, and verify'
- 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/master'))
- 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/master', 'refs/heads/develop'))
- task: GithubRelease@0
inputs:
gitHubConnection: 'github.com_FlorianRappl'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
displayName: 'Publish release'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))