-
Notifications
You must be signed in to change notification settings - Fork 78
/
release-azure-pipeline.yml
93 lines (77 loc) · 2.41 KB
/
release-azure-pipeline.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
#SurveyJS release pipeline (widgets)
#trigger only "by hand"
trigger: none
pr: none
pool:
vmImage: 'Ubuntu-16.04'
steps:
- checkout: self
persistCredentials: true
clean: true
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: '9434af9c-19e5-4e5d-8bd7-2d9129d3fed4'
pipeline: '31'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
downloadType: 'single'
artifactName: 'SurveyJSVersionFile'
downloadPath: '$(System.ArtifactsDirectory)'
displayName: 'Download Build Artifact - SurveyJSVersionFile'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/SurveyJSVersionFile/'
Contents: 'version.txt'
TargetFolder: '$(Build.Repository.LocalPath)/'
OverWrite: true
displayName: 'Copy Build Artifact - SurveyJSVersionFile'
- powershell: |
$version = Get-Content $(Build.Repository.LocalPath)/version.txt
Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version"
displayName: 'setup SurveyJSVersion variable from SurveyJSVersionFile'
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'install Node.js'
- script: |
npm install
displayName: 'npm install'
- powershell: |
echo $(git --version)
git config --global user.email "kurmanov.work@gmail.com"
git config --global user.name "dmitrykurmanov"
git checkout master
git pull origin master
git fetch --tags --force
npm run release -- --release-as $(SurveyJSVersion)
displayName: 'npm run release with SurveyJSVersion'
- script: |
npm run build
displayName: "build"
- script: |
npm run testcafe:ci
displayName: "run functional tests"
- powershell: |
git pull origin master
git push --follow-tags origin master;
displayName: 'push release commit to github'
- task: Npm@1
inputs:
command: "publish"
workingDir: "package"
publishEndpoint: "NPM Registry"
verbose: true
displayName: 'npm publish surveyjs-widgets'
#trigger next build via the artifact file 'version.txt'
- task: CopyFiles@2
inputs:
contents: 'version.txt'
targetFolder: $(Build.ArtifactStagingDirectory)
displayName: 'copy version file to Build.ArtifactStagingDirectory'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'SurveyJSVersionFile'
publishLocation: 'Container'
displayName: 'Publish Build Artifact - SurveyJSVersionFile'