-
Notifications
You must be signed in to change notification settings - Fork 22
/
azure-jobs.yml
331 lines (298 loc) · 12.4 KB
/
azure-jobs.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
parameters:
- name: enigmaref
default: ''
- name: repo
default: 'self'
jobs:
- ${{ if and(eq(parameters.repo, 'self'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
- job: CreateReleaseCandidate
displayName: 'Create Release Candidate'
timeoutInMinutes: 15
steps:
- task: GithubRelease@0
displayName: 'Create GitHub Release Candidate'
inputs:
gitHubConnection: github.com_EnigmaBot
repositoryName: enigma-dev/RadialGM
action: create
tagSource: manual
tag: '$(releasetag)'
isDraft: true
isPreRelease: true
- job: MINGW
timeoutInMinutes: 360
${{ if and(eq(parameters.repo, 'self'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
dependsOn: CreateReleaseCandidate
pool:
vmImage: windows-latest
strategy:
matrix:
i686:
MINGW_UPPER: MINGW32
MINGW_LOWER: mingw32
MINGW_ARCH: i686
x86_64:
MINGW_UPPER: MINGW64
MINGW_LOWER: mingw64
MINGW_ARCH: x86_64
steps:
- checkout: ${{ parameters.repo }}
submodules: true
path: RadialGM
persistCredentials: true
- ${{ if ne(parameters.repo, 'self') }}:
- script: |
cd $(Agent.BuildDirectory)/RadialGM/Submodules/enigma-dev
git remote remove origin
git remote add origin https://github.com/enigma-dev/enigma-dev.git
git remote -v
git fetch origin --force --tags --prune --progress ${{ parameters.enigmaref }}:enigmaref
git checkout --progress --force enigmaref
displayName: Checkout ENIGMA Reference
- powershell: |
choco install msys2
displayName: Install MSYS2
- script: |
set PATH=C:\tools\msys64\usr\bin
C:\tools\msys64\usr\bin\pacman --noconfirm -Syyuu
C:\tools\msys64\usr\bin\pacman --noconfirm --needed -S git base-devel mingw-w64-$(MINGW_ARCH)-toolchain mingw-w64-$(MINGW_ARCH)-cmake mingw-w64-$(MINGW_ARCH)-nsis mingw-w64-$(MINGW_ARCH)-protobuf mingw-w64-$(MINGW_ARCH)-grpc mingw-w64-$(MINGW_ARCH)-gflags mingw-w64-$(MINGW_ARCH)-yaml-cpp mingw-w64-$(MINGW_ARCH)-pugixml mingw-w64-$(MINGW_ARCH)-rapidjson mingw-w64-$(MINGW_ARCH)-boost mingw-w64-$(MINGW_ARCH)-qt5 mingw-w64-$(MINGW_ARCH)-qscintilla
C:\tools\msys64\usr\bin\pacman --noconfirm -Scc
displayName: Install Toolchain
- script: |
set PATH=C:\tools\msys64\usr\bin
cd $(Agent.BuildDirectory)/RadialGM/
C:\tools\msys64\usr\bin\bash -lc "bash ci-build.sh MinSizeRel $(PWD)/cmake-package"
displayName: 'Release Build'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
- script: |
set PATH=C:\tools\msys64\usr\bin
cd $(Agent.BuildDirectory)/RadialGM/
C:\tools\msys64\usr\bin\bash -lc "bash ci-build.sh Debug $(PWD)/cmake-package"
displayName: 'Debug Build'
env:
MSYSTEM: $(MINGW_UPPER)
CHERE_INVOKING: yes
MINGW_INSTALLS: $(MINGW_LOWER)
- script: |
cd $(Agent.BuildDirectory)/RadialGM
mkdir package
cd package
cmake -G "MSYS Makefiles" ../cmake-package
make package
mv ENIGMA-Installer*.exe $(Agent.BuildDirectory)/RadialGM-MinGW-$(MINGW_ARCH).exe
displayName: 'Package'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: '$(Agent.BuildDirectory)/RadialGM-MinGW-$(MINGW_ARCH).exe'
artifactName: RadialGM-MinGW-$(MINGW_ARCH)
- ${{ if eq(parameters.repo, 'self') }}:
- task: GithubRelease@0
displayName: 'Add MinGW to GitHub Release'
inputs:
gitHubConnection: github.com_EnigmaBot
repositoryName: enigma-dev/RadialGM
action: edit
tagSource: manual
tag: '$(releasetag)'
isDraft: true
isPreRelease: true
assetUploadMode: replace
assets: |
$(Agent.BuildDirectory)/RadialGM-MinGW-$(MINGW_ARCH).exe
- job: MSVC_64
displayName: 'MSVC x86_64'
${{ if and(eq(parameters.repo, 'self'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
dependsOn: CreateReleaseCandidate
pool:
vmImage: 'windows-latest'
timeoutInMinutes: 360
steps:
- checkout: ${{ parameters.repo }}
submodules: true
path: RadialGM
persistCredentials: true
- ${{ if ne(parameters.repo, 'self') }}:
- script: |
cd $(Agent.BuildDirectory)/RadialGM/Submodules/enigma-dev
git remote remove origin
git remote add origin https://github.com/enigma-dev/enigma-dev.git
git remote -v
git fetch origin --force --tags --prune --progress ${{ parameters.enigmaref }}:enigmaref
git checkout --progress --force enigmaref
displayName: Checkout ENIGMA Reference
- task: Cache@2
displayName: 'Cache VCPKG Artifacts'
inputs:
key: $(Agent.BuildDirectory)/RadialGM/msvc-x64-deps.txt | "$(vcpkgGitRef)" | "$(Agent.OS)"
path: '$(Build.BinariesDirectory)/vcpkg'
- task: run-vcpkg@0
displayName: 'Run VCPKG'
inputs:
vcpkgArguments: "@$(Agent.BuildDirectory)/RadialGM/msvc-x64-deps.txt"
vcpkgGitCommitId: $(vcpkgGitRef)
vcpkgGitURL: https://github.com/microsoft/vcpkg.git
- script: |
set PATH=%PATH%;$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\tools\qt5\bin\
set VCINSTALLDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC
call "%VCINSTALLDIR%\Auxiliary\Build\vcvars64.bat"
cd $(Build.SourcesDirectory)/RadialGM
mkdir Release
cd Release
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../cmake-package/Release -DCMAKE_BUILD_TYPE=MinSizeRel -DVCPKG_ROOT=$(Build.BinariesDirectory)\vcpkg -DVCPKG_TARGET_TRIPLET=x64-windows -DPROTOBUF_IMPORT_DIRS=$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\include -DCMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)\vcpkg\scripts\buildsystems\vcpkg.cmake $(Agent.BuildDirectory)\RadialGM
cmake --build . --config MinSizeRel
cmake --install . --config MinSizeRel
displayName: 'Release Build'
- script: |
set PATH=%PATH%;$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\debug\bin;$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\bin;$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\tools\qt5\debug\bin\
set VCINSTALLDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC
call "%VCINSTALLDIR%\Auxiliary\Build\vcvars64.bat"
cd $(Build.SourcesDirectory)/RadialGM
mkdir Debug
cd Debug
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../cmake-package/Debug -DCMAKE_BUILD_TYPE=Debug -DVCPKG_ROOT=$(Build.BinariesDirectory)\vcpkg -DVCPKG_TARGET_TRIPLET=x64-windows -DPROTOBUF_IMPORT_DIRS=$(Build.BinariesDirectory)\vcpkg\installed\x64-windows\include -DCMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)\vcpkg\scripts\buildsystems\vcpkg.cmake $(Agent.BuildDirectory)\RadialGM
cmake --build . --config Debug
cmake --install . --config Debug
displayName: 'Debug Build'
- script: |
cd $(Agent.BuildDirectory)/RadialGM
mkdir package
cd package
cmake -G "Visual Studio 16 2019" -A x64 ../cmake-package
cmake --build . --config Release --target PACKAGE
mv ENIGMA-Installer*.exe $(Agent.BuildDirectory)/RadialGM-MSVC-x86_64.exe
displayName: 'Package'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: '$(Agent.BuildDirectory)/RadialGM-MSVC-x86_64.exe'
artifactName: RadialGM-MSVC-x86_64
- ${{ if and(eq(parameters.repo, 'self'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
- task: GithubRelease@0
displayName: 'Add MSVC to GitHub Release'
inputs:
gitHubConnection: github.com_EnigmaBot
repositoryName: enigma-dev/RadialGM
action: edit
tagSource: manual
tag: '$(releasetag)'
isDraft: true
isPreRelease: true
assetUploadMode: replace
assets: |
$(Agent.BuildDirectory)/RadialGM-MSVC-x86_64.exe
- job: Mac
displayName: 'MacOS'
pool:
vmImage: 'macOS-11'
steps:
- checkout: ${{ parameters.repo }}
submodules: true
path: RadialGM
persistCredentials: true
- ${{ if ne(parameters.repo, 'self') }}:
- script: |
cd $(Agent.BuildDirectory)/RadialGM/Submodules/enigma-dev
git remote remove origin
git remote add origin https://github.com/enigma-dev/enigma-dev.git
git fetch origin --force --tags --prune --progress ${{ parameters.enigmaref }}:enigmaref
git checkout --progress --force enigmaref
displayName: Checkout ENIGMA Reference
- bash: |
set -e
brew install cmake protobuf grpc pugixml yaml-cpp rapidjson boost openssl@3 qt@5 qscintilla2 double-conversion harfbuzz
displayName: 'Install Deps'
- bash: |
set -e
cd $(Agent.BuildDirectory)/RadialGM
mkdir package
cd package
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=MinSizeRel -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 ..
cmake --build . --config MinSizeRel
displayName: 'Release Build'
- job: Arch
displayName: 'Arch Linux'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: ${{ parameters.repo }}
submodules: true
path: RadialGM
persistCredentials: true
- ${{ if ne(parameters.repo, 'self') }}:
- script: |
cd $(Agent.BuildDirectory)/RadialGM/Submodules/enigma-dev
git remote remove origin
git remote add origin https://github.com/enigma-dev/enigma-dev.git
git fetch origin --force --tags --prune --progress ${{ parameters.enigmaref }}:enigmaref
git checkout --progress --force enigmaref
displayName: Checkout ENIGMA Reference
- bash: |
set -e
cd $(Build.BinariesDirectory)
ARCH_URL=`curl -s https://mirrors.acm.wpi.edu/archlinux/iso/latest/ | egrep -o 'archlinux-bootstrap-([0-9._]+)-x86_64.tar.gz' | head -n1`
echo https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL
curl https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL -o arch.tar.gz
sudo tar xzf arch.tar.gz
sudo mount --bind ./root.x86_64/ ./root.x86_64/
sudo cp -R $(Agent.BuildDirectory)/RadialGM ./root.x86_64/
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
echo 'Server = https://mirrors.kernel.org/archlinux/\$repo/os/\$arch' >> /etc/pacman.d/mirrorlist
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --noconfirm base base-devel git gcc cmake protobuf grpc yaml-cpp pugixml rapidjson boost qt5 qscintilla-qt5
EOF
displayName: 'Bootstrap Archlinux'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd RadialGM
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ..
make
make install
cd ..
rm -rf build/
EOF
displayName: 'Release Build'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd RadialGM
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
make
make install
cd ..
rm -rf build/
EOF
displayName: 'Debug Build'
- ${{ if and(eq(parameters.repo, 'self'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
- job: PublishRelease
displayName: 'Publish Release'
timeoutInMinutes: 15
dependsOn:
- MINGW
- MSVC_64
steps:
- task: GithubRelease@0
displayName: 'Publish GitHub Release Candidate'
inputs:
gitHubConnection: github.com_EnigmaBot
repositoryName: enigma-dev/RadialGM
action: edit
tagSource: manual
tag: '$(releasetag)'
assetUploadMode: replace
isDraft: false
isPreRelease: true