-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
393 lines (317 loc) · 13.7 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# SurgeXT synth build script
# Bump: Aug 8 before 1.3.4
trigger: none
variables:
- group: mac-signing
- name: DECODE_PERCENTS
value: false
jobs:
- job: Build
condition: succeeded()
strategy:
matrix:
mac:
imageName: 'macos-latest'
isMac: true
windows:
imageName: 'windows-2022'
isWindows: true
x64: true
windows-x86:
imageName: 'windows-2022'
isWindows: true
x86: true
linux:
imageName: 'ubuntu-latest'
isLinux: true
pool:
vmImage: $(imageName)
steps:
- checkout: none
### SETUP SECTION
- bash: |
set -e
if [ "$SURGE_BRANCH" == "" ]; then
export SURGE_LOCAL_BRANCH='main'
else
export SURGE_LOCAL_BRANCH="${SURGE_BRANCH/refs\/heads\/}"
fi
if ! [[ $SURGE_LOCAL_BRANCH =~ ^(main|release-xt/.+)$ ]]; then
exit 1
fi
if [[ $SURGE_LOCAL_BRANCH =~ ^(main)$ ]]; then
export SURGE_IS_MAIN=true
echo "SURGE_IS_MAIN TRUE"
echo "##vso[task.setvariable variable=SURGE_IS_MAIN]true"
echo "##vso[task.setvariable variable=SURGE_IS_MAIN;isOutput=true]true"
else
export SURGE_IS_MAIN=false
echo "SURGE_IS_MAIN FALSE"
echo "##vso[task.setvariable variable=SURGE_IS_MAIN]false"
echo "##vso[task.setvariable variable=SURGE_IS_MAIN;isOutput=true]false"
fi
echo "SURGE_BRANCH=${SURGE_BRANCH}"
echo "SURGE_LOCAL_BRANCH=$SURGE_LOCAL_BRANCH"
echo "##vso[task.setvariable variable=SURGE_LOCAL_BRANCH]$SURGE_LOCAL_BRANCH"
echo "##vso[task.setvariable variable=SURGE_LOCAL_BRANCH;isOutput=true]$SURGE_LOCAL_BRANCH"
export SURGE_VERSION="${SURGE_LOCAL_BRANCH##*/}"
echo "SURGE_VERSION=$SURGE_VERSION"
# get the surge code
git clone --depth 5 --branch $SURGE_LOCAL_BRANCH https://github.com/surge-synthesizer/surge.git
cd surge
set +e
. ./scripts/misc/defensive-submodule.sh
set -e
if [ "$SURGE_VERSION" == "main" ]; then
export SURGE_VERSION="NIGHTLY-$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)"
fi
echo "SURGE_VERSION=$SURGE_VERSION"
echo "##vso[task.setvariable variable=SURGE_VERSION;]$SURGE_VERSION"
echo "##vso[task.setvariable variable=SURGE_VERSION;isOutput=true]$SURGE_VERSION"
name: surge
displayName: all - Setup Source and Version
### Do the dummy sign (macos only)
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'dev_id.p12'
certPwd: '$(MAC_EXPORTED_CERT_PW)'
condition: variables.isMac
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'inst_id.p12'
certPwd: '$(MAC_EXPORTED_CERT_PW)'
condition : variables.isMac
#### DO THE SURGE BUILDS
- bash: |
set -e
set -x
cd surge
export VUID=$(id -u)
export VGID=$(id -g)
docker pull baconpaul/sst-dockerimages-ubuntu18:3
docker create --user $VUID:$VGID --name surge-build-u18 --interactive --tty \
--env SURGE_VERSION=${SURGE_VERSION} \
--volume=`pwd`:/home/build/surge baconpaul/sst-dockerimages-ubuntu18:3
docker start surge-build-u18
docker exec surge-build-u18 bash -c "(cd /home/build/surge && ./scripts/docker-build/build.sh build --target surge-xt-distribution --parallel 6)"
docker stop surge-build-u18
condition: variables.isLinux
displayName: linux - Build Surge
- bash: |
set -e
cd surge
cmake -Bbuild -D AZURE_PIPELINE=1 -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build build --config Release --target surge-xt-distribution --parallel
displayName: macOS - Build Surge
condition: variables.isMac
env:
MAC_INSTALLING_CERT: $(MAC_INSTALLING_CERT)
MAC_SIGNING_1UPW: $(MAC_SIGNING_1UPW)
MAC_SIGNING_CERT: $(MAC_SIGNING_CERT)
MAC_SIGNING_ID: $(MAC_SIGNING_ID)
MAC_SIGNING_TEAM: $(MAC_SIGNING_TEAM)
- bash: |
set -e
cd surge
mkdir -p build
cmake -Bbuild -A x64 -DCMAKE_BUILD_TYPE=Release -D AZURE_PIPELINE=1
#cmake -Bbuild -GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Release -D AZURE_PIPELINE=1
condition: and(variables.isWindows, variables.x64)
displayName: win64 - Setup Project
- bash: |
set -e
cd surge
mkdir -p build
cmake -Bbuild -A Win32 -D AZURE_PIPELINE=1 -DCMAKE_BUILD_TYPE=Release
condition: and(variables.isWindows, variables.x86)
displayName: win32 - Setup Project
- bash: |
set -e
cd surge
cmake --build build --config Release --target surge-xt-distribution
condition: variables.isWindows
displayName: win - Build Surge
- bash: |
# ls -l surge/build/surge_xt_products/
ls -l surge/build/surge-xt-dist/
displayName: all - What was built?
# Make the tarball
- bash: |
cd surge
./scripts/misc/build-version-override.sh
cd ..
tar --exclude='./surge/ignore' --exclude='./surge/.git' --exclude='./surge/build*' -czvf surge/build/surge-xt-dist/surge-src-${SURGE_VERSION}.tar.gz ./surge
ls -al surge/build/surge-xt-dist/*.tar.gz
condition: variables.isLinux
displayName: linux - make tarball
# Finally make the git info
- bash: |
mkdir -p stage_git/git_info
cd surge
git log -1 --pretty=format:'%h : %s - %an' > ../stage_git/git_info/git_nightly_xt_log_display
git log -1 --pretty=format:'%h : %s%n%aD%n%an%n%n%B' > ../stage_git/git_info/git_nightly_xt_log_long_display
git log -5 --pretty=format:'%h : %s - %an' > ../stage_git/git_info/git_nightly_xt_recent_five
git log -1 --pretty=format:'%h' > ../stage_git/git_info/git_nightly_xt_log_hash
cd ..
cat stage_git/git_info/*
condition: variables.isLinux
displayName: Use the linux build to make git log info
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'GIT_INFO'
targetPath: 'stage_git/'
condition: variables.isLinux
displayName: Publish the Git Info
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_MAC_DIST'
targetPath: 'surge/build/surge-xt-dist'
condition: variables.isMac
displayName: mac - publish mac zip
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_LIN_DIST'
targetPath: 'surge/build/surge-xt-dist'
condition: variables.isLinux
displayName: linux - publish linux zip
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_WIN_DIST'
targetPath: 'surge/build/surge-xt-dist'
condition: and(variables.isWindows, variables.x64)
displayName: win64 - publish windows zip
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_WIN_X86_DIST'
targetPath: 'surge/build/surge-xt-dist'
condition: and(variables.isWindows, variables.x86)
displayName: win32 - publish installer
- job: Release
dependsOn: Build
condition: succeeded()
strategy:
matrix:
release-on-mac:
imageName: 'macos-10.15'
variables:
SURGE_VERSION: $[ dependencies.Build.outputs['mac.surge.SURGE_VERSION'] ]
SURGE_LOCAL_BRANCH: $[ dependencies.Build.outputs['mac.surge.SURGE_LOCAL_BRANCH'] ]
SURGE_IS_MAIN: $[ dependencies.Build.outputs['mac.surge.SURGE_IS_MAIN'] ]
INSTALL_TO_NIGHTLY: $[ eq( variables.SURGE_IS_MAIN, 'true') ]
steps:
- checkout: self
persistCredentials: true
- task: DownloadSecureFile@1
inputs:
secureFile: discord-nightly.webhook
- task: DownloadSecureFile@1
inputs:
secureFile: checkout-website.sh
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_MAC_DIST'
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_WIN_DIST'
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_WIN_X86_DIST'
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_LIN_DIST'
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'GIT_INFO'
targetPath: $(System.DefaultWorkingDirectory)
- bash: |
set -e
set -x
echo "SURGE_VERSION: $SURGE_VERSION"
echo "SURGE_LOCAL_BRANCH: $SURGE_LOCAL_BRANCH"
echo "SURGE_IS_MAIN: $SURGE_IS_MAIN"
echo "INSTALL_TO_NIGHTLY: $INSTALL_TO_NIGHTLY"
mkdir -p releases
ls $(System.DefaultWorkingDirectory)/git_info
mv *.zip *.exe *.dmg *.deb *.gz *.rpm releases
echo "Surge XT ${SURGE_VERSION}" > releases/ReleaseNotes.md
echo " " >> releases/ReleaseNotes.md
echo "<pre>" >> releases/ReleaseNotes.md
cat $(System.DefaultWorkingDirectory)/git_info/git_nightly_xt_recent_five >> releases/ReleaseNotes.md
echo " " >> releases/ReleaseNotes.md
echo "</pre>" >> releases/ReleaseNotes.md
echo "---------------"
cat releases/ReleaseNotes.md
echo "---------------"
md5sum releases/*.* > releases/md5sum.txt
ls -alFh releases
displayName: Prepare Release
- task: GitHubRelease@0
displayName: "Create Github Nightly Release"
condition: eq(variables.SURGE_IS_MAIN, 'true')
inputs:
gitHubConnection: surge-rackupdater
repositoryName: surge-synthesizer/releases-xt
action: 'edit'
tag: Nightly
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(System.DefaultWorkingDirectory)/releases/ReleaseNotes.md
assets: $(System.DefaultWorkingDirectory)/releases/*.*
- bash: |
git tag $(SURGE_VERSION)
git push origin $(SURGE_VERSION)
displayName: "Create Github Tag for Stable"
condition: eq(variables.SURGE_IS_MAIN, 'false')
- task: GitHubRelease@0
displayName: "Create Github Stable Release"
condition: eq(variables.SURGE_IS_MAIN, 'false')
inputs:
gitHubConnection: surge-rackupdater
repositoryName: surge-synthesizer/releases-xt
action: 'create'
tag: $(SURGE_VERSION)
tagSource: 'auto'
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(System.DefaultWorkingDirectory)/releases/ReleaseNotes.md
assets: $(System.DefaultWorkingDirectory)/releases/*.*
- bash: |
. $AGENT_TEMPDIRECTORY/checkout-website.sh
pushd surge-synthesizer.github.io
if [ "$SURGE_LOCAL_BRANCH" == "main" ]; then
echo $(date "+%Y-%m-%d %H:%M:%S %Z") > src/assets/includes/latest_xt_build_time
echo $SURGE_VERSION > src/assets/includes/latest_xt_version
cp ../git_info/* src/assets/includes
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-macOS-$SURGE_VERSION.dmg > src/assets/includes/latest_xt_macos_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-win64-$SURGE_VERSION-setup.exe > src/assets/includes/latest_xt_win_x64_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-win64-$SURGE_VERSION-pluginsonly.zip > src/assets/includes/latest_xt_win_x64_zip_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-win32-$SURGE_VERSION-setup.exe > src/assets/includes/latest_xt_win_x86_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-win32-$SURGE_VERSION-pluginsonly.zip > src/assets/includes/latest_xt_win_x86_zip_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/Nightly/surge-xt-linux-x64-$SURGE_VERSION.deb > src/assets/includes/latest_xt_linux_x64_url
else
echo $(date "+%Y-%m-%d %H:%M:%S %Z") > src/assets/includes/stable_xt_build_time
echo $SURGE_VERSION > src/assets/includes/stable_xt_version
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-macOS-$SURGE_VERSION.dmg > src/assets/includes/stable_xt_macos_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-win64-$SURGE_VERSION-setup.exe > src/assets/includes/stable_xt_win_x64_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-win64-$SURGE_VERSION-pluginsonly.zip > src/assets/includes/stable_xt_win_x64_zip_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-win32-$SURGE_VERSION-setup.exe > src/assets/includes/stable_xt_win_x86_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-win32-$SURGE_VERSION-pluginsonly.zip > src/assets/includes/stable_xt_win_x86_zip_url
echo https://github.com/surge-synthesizer/releases-xt/releases/download/$SURGE_VERSION/surge-xt-linux-x64-$SURGE_VERSION.deb > src/assets/includes/stable_xt_linux_x64_url
echo https://github.com/surge-synthesizer/releases-xt/releases/tag/$SURGE_VERSION > src/assets/includes/stable_xt_other.url
fi
git diff
git add src/assets/includes
git commit -m "Update releases for $SURGE_VERSION"
git push
displayName: Update Website
- bash: |
# Finally tell discord
export GIT_LOG_DISP=`cat git_info/git_nightly_xt_log_display | sed -e s/\"//g`
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"A SurgeXT Beta Build is available. Get it here:\n*${SURGE_VERSION}*\n${GIT_LOG_DISP}\nhttps://surge-synthesizer.github.io/nightly_XT\"}" `cat $AGENT_TEMPDIRECTORY/discord-nightly.webhook`
displayName: Tell Discord