forked from surge-synthesizer/monique-monosynth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
281 lines (234 loc) · 9.01 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
# Hacky secret project 3
trigger:
- main
pr:
- main
variables:
- group: mac-signing
jobs:
- job: Build
strategy:
matrix:
mac:
imageName: 'macos-12'
releaseAsset: True
isMac: True
cmakeRelArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmakeDebArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmakePRTarget: monique-staged
win:
imageName: 'windows-2019'
isWindows: True
releaseAsset: True
cmakeRelArgs: -A x64
cmakeDebArgs: -A x64
cmakePRTarget: monique-staged
lin:
imageName: 'ubuntu-20.04'
isLinux: True
releaseAsset: True
cmakeRelArgs:
cmakeDebArgs:
cmakePRTarget: monique-staged
linux-codequality:
imageName: 'ubuntu-20.04'
isLinux: True
cmakePRTarget: "code-quality-pipeline-checks"
pool:
vmImage: $(imageName)
steps:
- checkout: self
fetchDepth: 5
# submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github
- bash: |
set -e
sudo apt-get update
sudo apt-get install -y \
devscripts \
libxcb-cursor-dev \
libxcb-keysyms1-dev \
libxcb-util-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
ninja-build \
xcb \
libgtk-3-dev \
libwebkit2gtk-4.0 \
libwebkit2gtk-4.0-dev \
libcurl4-openssl-dev \
alsa \
alsa-tools \
libasound2-dev \
libjack-dev \
libfreetype6-dev \
libxinerama-dev \
libxcb-xinerama0 \
libxinerama1 \
x11proto-xinerama-dev \
libxrandr-dev \
libgl1-mesa-dev \
libxcursor-dev \
libxcursor1 \
libxcb-cursor-dev \
libxcb-cursor0
condition: variables.isLinux
displayName: linux - run apt-get
- 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
- bash: |
git submodule update --depth 1 --init --recursive
displayName: Get SubModules
- bash: |
echo cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug $(cmakeDebArgs)
cmake -Bbuild -DAZURE_PIPELINE=1 -DCMAKE_BUILD_TYPE=Debug $(cmakeDebArgs)
displayName: Run CMake (Debug)
condition: eq(variables['Build.Reason'], 'PullRequest')
- bash: |
echo cmake --build build --config Debug --target $(cmakePRTarget) --parallel 4
cmake --build build --config Debug --target $(cmakePRTarget) --parallel 4
displayName: Build Monique for a Pull Request
condition: eq(variables['Build.Reason'], 'PullRequest')
- bash: |
echo cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug $(cmakeRelArgs)
cmake -Bbuild -DAZURE_PIPELINE=1 -DCMAKE_BUILD_TYPE=Release $(cmakeRelArgs)
displayName: Run CMake (Release)
condition: not(eq(variables['Build.Reason'], 'PullRequest'))
- bash: |
cmake --build build --config Release --target monique-installer --parallel 4
displayName: Build Monique Installer for Main
condition: and(not(eq(variables['Build.Reason'], 'PullRequest')),variables.releaseAsset)
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: |
mkdir -p build/stage_git/git_info
git log -1 --pretty=format:'%h : %s - %an' > build/stage_git/git_info/git_nightly_monique_log_display
git log -1 --pretty=format:'%h : %s%n%aD%n%an%n%n%B' > build/stage_git/git_info/git_nightly_monique_log_long_display
git log -5 --pretty=format:'%h : %s - %an' > build/stage_git/git_info/git_nightly_monique_recent_five
git log -1 --pretty=format:'%h' > build/stage_git/git_info/git_nightly_monique_log_hash
cat build/stage_git/git_info/*
condition: and(variables.isLinux, not(eq(variables['Build.Reason'], 'PullRequest')), variables.releaseAsset)
displayName: Use the linux build to make git log info
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_MAC_DIST'
targetPath: 'build/installer'
condition: and(variables.isMac,not(eq(variables['Build.Reason'], 'PullRequest')),variables.releaseAsset)
displayName: mac - publish mac dmg
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_WIN_DIST'
targetPath: 'build/installer'
condition: and(variables.isWindows,not(eq(variables['Build.Reason'], 'PullRequest')),variables.releaseAsset)
displayName: win - publish win zip
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'INSTALLER_LIN_DIST'
targetPath: 'build/installer'
condition: and(variables.isLinux,not(eq(variables['Build.Reason'], 'PullRequest')), variables.releaseAsset)
displayName: lin - publish lin zip
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'GIT_INFO'
targetPath: 'build/stage_git/'
condition: and(variables.isLinux,not(eq(variables['Build.Reason'], 'PullRequest')),variables.releaseAsset)
displayName: lin - publish git info
# Release Stage
- job: Release
dependsOn: Build
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
strategy:
matrix:
release-on-mac:
imageName: 'macos-10.15'
steps:
- checkout: self
persistCredentials: true
- task: DownloadSecureFile@1
inputs:
secureFile: discord-nightly-monique.webhook
- 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_LIN_DIST'
targetPath: $(System.DefaultWorkingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'GIT_INFO'
targetPath: $(System.DefaultWorkingDirectory)
- bash: |
set -e
set -x
mkdir -p releases
mv *.zip *.dmg *.exe *.tar.xz releases
ls -l $(System.DefaultWorkingDirectory)/git_info/
echo "## Monique Nightly Build" > releases/ReleaseNotes.md
echo " " >> releases/ReleaseNotes.md
date +"**Last Updated On: %Y-%m-%d %H:%M:%S %Z**" >> releases/ReleaseNotes.md
echo " " >> releases/ReleaseNotes.md
echo "5 most recent commits in this install:" >> releases/ReleaseNotes.md
echo "<pre>" >> releases/ReleaseNotes.md
cat $(System.DefaultWorkingDirectory)/git_info/git_nightly_monique_recent_five >> releases/ReleaseNotes.md
echo " " >> releases/ReleaseNotes.md
echo "</pre>" >> releases/ReleaseNotes.md
echo "---------------"
cat releases/ReleaseNotes.md
echo "---------------"
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/monique-monosynth
action: 'edit'
tag: Nightly
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(System.DefaultWorkingDirectory)/releases/ReleaseNotes.md
assets: $(System.DefaultWorkingDirectory)/releases/*.*
# ToDo: Non-nightly release
# - 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: |
# Finally tell discord
export GIT_LOG_DISP=`cat git_info/git_nightly_monique_log_display | sed -e s/\"//g`
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"A Monique Nightly is available. Get it here:\n${GIT_LOG_DISP}\nhttps://github.com/surge-synthesizer/monique-monosynth/releases/tag/Nightly\"}" `cat $AGENT_TEMPDIRECTORY/discord-nightly-monique.webhook`
displayName: Tell Discord