forked from surveyjs/survey-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-azure-pipeline.yml
155 lines (128 loc) · 3.61 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Start SurveyJS release pipeline (survey-library)
#trigger only "by hand"
trigger: none
pr: none
#Uncomment for specific version
variables:
SurveyJSVersion: '1.8.16'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- checkout: self
persistCredentials: true
clean: true
- 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 "[email protected]"
git config --global user.name "dmitrykurmanov"
git checkout master
git pull origin master
git fetch --tags --force
displayName: 'git prepare'
# # Comment for specific version
# - powershell: |
# npm run release
# displayName: 'npm run release standart'
#Uncomment for specific version
- powershell: |
npm run release -- --release-as $(SurveyJSVersion)
displayName: 'npm run release specific version'
- powershell: |
$version = (git describe --tags).replace("v", "")
Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version"
displayName: 'npm run release and setup env var SurveyJSVersion'
- script: |
npm run build_prod
displayName: 'build'
- script: |
npm run testsingle
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'
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_dmitrykurmanov'
repositoryName: 'surveyjs/survey-library'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
- script: |
npm run doc_gen
displayName: 'generate docs'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-angular'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-angular'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-react'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-react'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-vue'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-vue'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-knockout'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-knockout'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-jquery'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-jquery'
- task: Npm@1
inputs:
command: 'publish'
workingDir: 'build/survey-core'
publishEndpoint: 'NPM Registry'
verbose: true
displayName: 'npm publish survey-core'
- script: |
npm run doc_update
displayName: 'update docs'
# create build artifact file 'version.txt'
- powershell: |
New-Item "version.txt"
Set-Content version.txt $(SurveyJSVersion)
Get-Content version.txt
displayName: 'create version file as build artifact'
#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'