-
Notifications
You must be signed in to change notification settings - Fork 51
/
release-azure-pipeline.yml
111 lines (91 loc) · 2.74 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#SurveyJS release pipeline (survey-analytics)
#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: '43'
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:prod
displayName: 'build'
- script: |
npm run build:types:summary
npm run build:types:datatables
npm run build:types:tabulator
displayName: "build typings"
- script: |
npm test
displayName: 'unit tests'
- script: |
npm run testcafe_ci
displayName: 'functional tests'
- powershell: |
git pull origin master
git push --follow-tags origin master;
displayName: 'push release commit to github'
- script: |
npm run doc_gen
displayName: "generate docs"
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'packages'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-analytics'
- script: |
npm run doc_update
displayName: "update docs"
#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'