forked from surge-synthesizer/stochas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
317 lines (283 loc) · 10.1 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
# Build tuning-workbench-synth with JUCE buidls
trigger:
branches:
include:
- main
tags:
include:
- v* # only build release tags
pr:
- main
jobs:
- job: Build
strategy:
matrix:
mac:
imageName: 'macos-10.14'
isMac: True
doUpload: True
win-2017:
imageName: 'vs2017-win2016'
isWindows: True
win-2019:
imageName: 'windows-2019'
isWindows: True
doUpload: True
lin-18:
imageName: 'ubuntu-18.04'
isLinux: True
doUpload: True
lin-20:
imageName: 'ubuntu-20.04'
isLinux: True
pool:
vmImage: $(imageName)
steps:
- checkout: self
fetchDepth: 1
# submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github
- bash: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libwebkit2gtk-4.0
sudo apt-get install -y libwebkit2gtk-4.0-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y alsa
sudp apt-get install -y alsa-tools
sudo apt-get install -y libasound2-dev
sudo apt-get install -y jack
sudo apt-get install -y libjack-dev
sudo apt-get install -y libfreetype6-dev
sudo apt-get install -y libxinerama-dev
sudo apt-get install -y libxcb-xinerama0
sudo apt-get install -y libxinerama1
sudo apt-get install -y x11proto-xinerama-dev
sudo apt-get install -y libxrandr-dev
sudo apt-get install -y libgl1-mesa-dev
sudo apt-get install -y libxcursor-dev
sudo apt-get install -y libxcursor1
sudo apt-get install -y libxcb-cursor-dev
sudo apt-get install -y libxcb-cursor0
sudo apt-get install -y --fix-missing
apt list --installed
find /usr/include -name "asoundlib.h" -print
displayName: Prepare Linux Host
condition: variables.isLinux
- bash: |
set -ex
git submodule update --init --recursive
displayName: Submodule Update
- bash: |
export SVER=`cat VERSION`
export GH=`git log -1 --format=%h`
echo "Version ${SVER} hash ${GH}"
# make it available below
echo "##vso[task.setvariable variable=STOCHAS_VERSION]${SVER}"
echo "##vso[task.setvariable variable=GH;isOutput=true]${GH}"
displayName: Determine Version
#
# MAC BUILD AND CREATE DMG OF FILES
#
- bash: |
set -ex
# For now we expand this out so we can swap the STOCHAS_IS_SYNTH flag for the AU off
cmake -Bbuild -GXcode -DSTOCHAS_VERSION=${STOCHAS_VERSION}
cmake --build build --target stochas_VST3 --config Release | xcpretty
cmake --build build --target stochas_Standalone --config Release | xcpretty
mkdir build/tmpasset
cp -r build/stochas_artefacts/Release/VST3/* build/tmpasset
cp -r build/stochas_artefacts/Release/Standalone/* build/tmpasset
cmake -Bbuild -DSTOCHAS_IS_SYNTH=FALSE -DSTOCHAS_VERSION=${STOCHAS_VERSION}
cmake --build build --target stochas_AU --config Release | xcpretty
cp -r build/stochas_artefacts/Release/AU/* build/tmpasset
NM=stochas-${STOCHAS_VERSION}.${GH}-mac.dmg
mkdir -p build/product/
hdiutil create build/product/${NM} -ov -volname "Stochas ${STOCHAS_VERSION}" -fs HFS+ -srcfolder build/tmpasset
displayName: Build Mac
condition: variables.isMac
#
# MAC EXECUTABLE INSTALLER
#
- bash: |
set -ex
# pull the packages from build assets to save bandwidth since this is normally a bit slow from the
# original site
wget -nv -O mac_packages https://github.com/surge-synthesizer/build-assets/raw/master/packages/Packages.dmg
mv mac_packages $(brew --cache -s packages)
brew install --cask packages
# path needed by packagesbuild
PACKAGES_TARGET=build.install/mac/stochas
mkdir -p ${PACKAGES_TARGET}
# some debugging help
find build/stochas_artefacts/Release -print
packagesbuild --package-version ${STOCHAS_VERSION} "install/mac/Stochas.pkgproj"
NM=stochas-mac-installer.dmg
hdiutil create -volname "Stochas ${STOCHAS_VERSION} Installer" -srcfolder ${PACKAGES_TARGET} -ov -fs HFS+ build/product/${NM}
displayName: Build Mac Installer
condition: and(variables.isMac, variables.doUpload)
#
# WIN BUILD AND CREATE ZIP OF FILES
#
- bash: |
set -ex
# 64 bit
cmake -Bbuild -A x64 -DSTOCHAS_VERSION=${STOCHAS_VERSION}
cmake --build build --config Release
# 32 bit
cmake -Bbuild32 -A Win32 -DSTOCHAS_VERSION=${STOCHAS_VERSION}
cmake --build build32 --config Release
mkdir -p build/product
mkdir -p zip/x86
mkdir -p zip/x64
cp -r build/stochas_artefacts/Release/VST3/* zip/x64
cp -r build/stochas_artefacts/Release/Standalone/* zip/x64
cp -r build32/stochas_artefacts/Release/VST3/* zip/x86
cp -r build32/stochas_artefacts/Release/Standalone/* zip/x86
NM=stochas-${STOCHAS_VERSION}.${GH}-win.zip
# see what we have
find build
powershell Compress-Archive -DestinationPath "build/product/${NM}" -Force -Path "zip"
displayName: Build Windows
condition: variables.isWindows
#
# WIN SETUP
#
- bash: |
set -ex
# build the innosetup install
nuget install innosetup
mkdir -p build/product/
iscc //Obuild\\product //Fstochas_windows_installer //DSTOCHAS_VERSION=${STOCHAS_VERSION}.${GH} "install\\win\\install.iss"
displayName: Package Windows
condition: and(variables.isWindows, variables.doUpload)
#
# LINUX
#
- bash: |
set -ex
cmake -Bbuild -DSTOCHAS_VERSION=${STOCHAS_VERSION}
cmake --build build --config Release
LINARCH=`uname -m`
NM=stochas-${STOCHAS_VERSION}.${GH}-linux-${LINARCH}.tgz
mkdir -p build/product/
mkdir -p build/Stochas/Standalone
cp -r build/stochas_artefacts/VST3/* build/Stochas
cp -r build/stochas_artefacts/Standalone/* build/Stochas/Standalone
tar czf "build/product/${NM}" -C build Stochas
displayName: Build Linux
condition: variables.isLinux
#
# PUBLISH ARTIFACTS
#
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'MACOS_BUILD'
targetPath: 'build/product/'
displayName: Publish Mac DMG
condition: and(variables.isMac, variables.doUpload)
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'WINDOWS_BUILD'
targetPath: 'build/product/'
displayName: Publish Windows Zip
condition: and(variables.isWindows, variables.doUpload)
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'LINUX_BUILD'
targetPath: 'build/product/'
displayName: Publish Linux Tar
condition: and(variables.isLinux, variables.doUpload)
#
# UPDATE GITHUB RELEASES
#
- job: UpdateGithubRelease
dependsOn: Build
# only publish if it was merged to main (ie not on a pr) or if a tag was pushed
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/')))
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'MACOS_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'WINDOWS_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'LINUX_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
scripts/release-notes.sh > $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
ls $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/*
displayName: Fake up release notes and tag release
- bash: |
GH=`git log -1 --format=%h`
DATE=$(date '+%Y-%m-%d')
# make it available below
echo "##vso[task.setvariable variable=GH]$GH"
echo "##vso[task.setvariable variable=BUILD_DATE;]$DATE"
displayName: Determine Hash
#
# Developer release
#
- task: GitHubRelease@0
displayName: "Create Dev Release"
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
gitHubConnection: surge-rackupdater
repositoryName: surge-synthesizer/stochas
action: 'edit'
# Required when action == Create# Options: auto, manual
tagSource: manual
# we create a new tag
#tag: v1.0.1.$(GH)
tag: developer
title: Dev Release $(BUILD_DATE) $(GH)
isPreRelease: true
target: '$(Build.SourceVersion)'
addChangeLog: true
assetUploadMode: 'delete'
releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
assets: $(Build.ArtifactStagingDirectory)/*.*
#
# STABLE RELEASE WHEN TAGGED with vX.X.X
#
- task: GitHubRelease@0
displayName: "Create or edit New 'Stable' Release"
# will only run when we tag something starting with v
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
inputs:
gitHubConnection: surge-rackupdater
repositoryName: surge-synthesizer/stochas
action: 'edit'
title: Stable Release ${{ replace(variables['Build.SourceBranch'], 'refs/tags/','') }}
tagSource: manual
# extract just the tag
tag: ${{ replace(variables['Build.SourceBranch'], 'refs/tags/','') }}
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
assets: $(Build.ArtifactStagingDirectory)/*.*
#
# PUBLISH CANONICAL WHEN RELEASE
#
- task: GitHubRelease@0
displayName: "Edit canonical latest"
# will only run when we tag something starting with v
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
inputs:
gitHubConnection: surge-rackupdater
repositoryName: surge-synthesizer/stochas
action: 'edit'
title: Latest Stable Release
tagSource: manual
# extract just the tag
tag: release_dl
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
assets: $(Build.ArtifactStagingDirectory)/*.*