forked from Mobsya/aseba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
325 lines (288 loc) · 12.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
resources:
containers:
- container: fpkde
options: '--privileged'
image: mobsya/flatpak-builders:kde-latest
trigger:
tags:
include:
- 2.*
branches:
include:
- '*'
variables:
- group: passwords
- name: blockly_version
value: "v20200506.1"
- name: scratch_version
value: "v20210422.4"
- name: packet_version
value: "2.2.0"
- name: blockly_url
value: "https://github.com/Mobsya/thymio-blockly-standalone/releases/download/$(blockly_version)/thymio-blockly.tar.gz"
- name: scratch_url
value: "https://github.com/Mobsya/scratch-gui/releases/download/$(scratch_version)/scratch-gui.tar.gz"
- name: vpl3_url
value: "https://github.com/Mobsya/ci-data/releases/download/data/vpl3-thymio-suite.tar.gz"
- name: vcpkg_commit
value: "cccef600decd1091a20a0b4d8a2e61f7041eb686"
- name: visual_bootstrapper
value: "https://github.com/Mobsya/ci-data/releases/download/data/vs_enterprise.exe"
jobs:
- job: 'BuildFlatpak'
pool:
vmImage: 'Ubuntu-16.04'
container: fpkde
steps:
- script: |
git submodule update --init --recursive
flatpak remote-add --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak-builder --user --install-deps-from=flathub --force-clean --keep-build-dirs -v --repo=bundle build-dir flatpak/org.mobsya.ThymioSuite.json
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo bundle $(Build.ArtifactStagingDirectory)/ThymioSuite-$(packet_version).flatpak org.mobsya.ThymioSuite
displayName: 'Build flatpak bundle'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'thymio-suite.flatpak'
- job: 'MSVC'
timeoutInMinutes: 90
pool:
vmImage: windows-2019
strategy:
matrix:
x64:
ARCH: 'x64'
vcpkgTriplet: 'x64-windows-static'
QT_URL: "https://github.com/Mobsya/ci-data/releases/download/data/qt-5.15.2-msvc-x64.7z"
CMAKE_PREFIX_PATH: $(Build.BinariesDirectory)/Qt/5.15.2/msvc2019_64/
cmake_generator: "Visual Studio 16 2019"
ARCH_CMAKE: "-A x64 -T version=14.25"
VCINSTALLDIR: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC"
x86:
ARCH: 'x86'
vcpkgTriplet: 'x86-windows-static'
QT_URL: "https://github.com/Mobsya/ci-data/releases/download/data/qt-5.15.2-msvc-x86.7z"
CMAKE_PREFIX_PATH: $(Build.BinariesDirectory)/Qt/5.15.2/msvc2019
cmake_generator: "Visual Studio 16 2019"
ARCH_CMAKE: "-A Win32 -T version=14.25"
VCINSTALLDIR: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC"
steps:
- script: |
git submodule update --init --recursive
displayName: Update submodules
- script: |
makensis -VERSION
displayName: Install NSIS
- task: Cache@2
displayName: Cache vcpkg
inputs:
key: $(Build.SourcesDirectory)/vcpkg-list.txt| "$(vcpkg_commit)" | "windows-2019" | "6" | $(vcpkgTriplet)
path: '$(Build.BinariesDirectory)/vcpkg'
- task: Cache@2
displayName: 'Qt Cache'
inputs:
key: Qt_5_12_3 | "$(QT_URL)" | "2"
path: $(Build.BinariesDirectory)/Qt/
cacheHitVar: QT_LIB_CACHE_RESTORED
- task: lucappa.cmake-ninja-vcpkg-tasks.d855c326-b1c0-4d6f-b1c7-440ade6835fb.run-vcpkg@0
displayName: 'Run vcpkg'
inputs:
vcpkgTriplet: '$(vcpkgTriplet)'
vcpkgArguments: '@$(Build.SourcesDirectory)/vcpkg-list.txt'
vcpkgGitCommitId: "$(vcpkg_commit)"
vcpkgGitURL: https://github.com/mobsya/vcpkg.git
- powershell: |
Get-ChildItem $(Build.BinariesDirectory)/vcpkg -recurse -include *.o | remove-item
Remove-Item -Recurse -Force $(Build.BinariesDirectory)/vcpkg/buildtrees -ErrorAction Ignore
Remove-Item -Recurse -Force $(Build.BinariesDirectory)/vcpkg/downloads -ErrorAction Ignore
displayName: 'Remove vcpkg object files'
- powershell: |
$output = [System.IO.Path]::GetTempFileName()
Invoke-WebRequest -Verbose -UseBasicParsing -Uri "$(QT_URL)" -OutFile $output
7z -bb -y x $output -o$(Build.BinariesDirectory)
condition: ne(variables.QT_LIB_CACHE_RESTORED, 'true')
displayName: Fetch Qt
- task: PythonScript@0
displayName: Fetch scratch, blockly and vpl3
inputs:
scriptSource: 'inline'
script: |
from urllib.request import urlretrieve
import tarfile
def extract(url, file):
print("{} -> {}".format(url, file))
urlretrieve(url, file)
tar = tarfile.open(file, "r:gz")
tar.extractall()
tar.close()
extract('$(blockly_url)', 'thymio-blockly.tar.gz')
extract('$(scratch_url)', 'scratch-gui.tar.gz')
extract('$(vpl3_url)', 'vpl3-thymio-suite.tar.gz')
- task: DownloadSecureFile@1
name: wincert
inputs:
secureFile: "mobsya-windows.pfx"
- script: |
if exist "C:\Program Files\CMake\bin" set PATH=C:\Program Files\CMake\bin;%PATH%
set "PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\App Certification Kit\\"
cpack.exe --version
cmake.exe --version
cmake -G "$(cmake_generator)" $(ARCH_CMAKE) -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(Build.BinariesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/windows/cl-toolchain.cmake" "-DVCPKG_TARGET_TRIPLET=$(vcpkgTriplet)" -DFLATBUFFERS_BUILD_TESTS=OFF -DCREATE_QT_CONF_FILE=ON $(Build.SourcesDirectory)
cmake --build . --config Release --parallel
cpack.exe -G NSIS --verbose --debug
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Run CMake and CPack'
env:
SIGNTOOL_PFX: $(wincert.secureFilePath)
SIGNTOOL_PASSPHRASE: $(mobsya-win-p12)
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.BinariesDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: 'ThymioSuite-*.exe'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'ThymioSuite.exe'
- job: 'BuildAndroid_armeabi'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
armeabi:
TARGET_ARCH: 'armeabi-v7a'
aarch64:
TARGET_ARCH: 'arm64-v8a'
x86_64:
TARGET_ARCH: 'x86_64'
steps:
- script: |
docker pull mobsya/android-dev-env:$TARGET_ARCH
- script: |
wget -q $(blockly_url) && tar xzf thymio-blockly.tar.gz -C .
wget -q $(scratch_url) && tar xzf scratch-gui.tar.gz -C .
wget -q $(vpl3_url) && tar xzf vpl3-thymio-suite.tar.gz -C .
displayName: 'Extract scratch, blockly and vpl3'
- script: |
git submodule update --init --recursive
displayName: 'Clone submodules'
- script: |
sudo docker run --rm -e TARGET_ARCH=${TARGET_ARCH} -v $(pwd):/src:rw -v $(Build.ArtifactStagingDirectory):/build:rw mobsya/android-dev-env:$TARGET_ARCH /bin/bash -c 'cd /src && mkdir build && cd build && export CMAKE_PREFIX_PATH="/Qt/android_${TARGET_ARCH}" && cmake -DANDROID_PLATFORM=android-22 -DANDROID_ABI=${TARGET_ARCH} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH=/Qt/android_${TARGET_ARCH} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF ../ -GNinja && ninja && cp bin/*.apk /build/thymio-suite-${TARGET_ARCH}.apk'
displayName: 'Build Thymio Suite'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'thymio-suite-android'
- job: BuildOnOsX
pool:
vmImage: 'macOS-10.14'
steps:
- task: NodeTool@0
inputs:
versionSpec: '9.x'
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'Mobsya.p12'
certPwd: $(mobsya-mac-p12)
- script: |
curl -sL $(blockly_url) | tar xzf - -C .
curl -sL $(scratch_url) | tar xzf - -C .
curl -sL $(vpl3_url) | tar xzf - -C .
displayName: 'Extract scratch, blockly and vpl3'
- script: |
curl -sL https://github.com/Mobsya/ci-data/releases/download/data/qt-5.13.2-mac.7z --output mac.7z
7z x mac.7z
displayName: 'Setting Qt version to 5.13.2'
#workaround until devops deploy
- script: |
brew uninstall [email protected]
brew untap local/openssl
brew bundle
displayName: 'Install dependencies with HomeBrew'
- script: |
brew tap mobsya/brewqt https://github.com/mobsya/brewqt
brew extract --version=1.0.2t openssl mobsya/brewqt
brew install mobsya/brewqt/[email protected]
brew info openssl
displayName: 'Setting openssl version to 1.0.0'
- script: |
git submodule update --init --recursive
displayName: 'Clone submodules'
- script: |
sudo xcode-select -s /Applications/Xcode_11.3.1.app/Contents/Developer
(mkdir build && cd build && cmake .. -GNinja -DBoost_DEBUG=OFF -DOPENSSL_LIBRARIES=/usr/local/Cellar/[email protected]/1.0.2t/lib -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/[email protected]/1.0.2t/include -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH="`pwd`/../Qt/5.13.2/clang_64/" && ninja)
displayName: 'Build with cmake'
- script: |
osx/createbundle.sh $(Build.ArtifactStagingDirectory)/ThymioSuite-$(packet_version)-OsX-12-15.dmg build/bin '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
displayName: 'Signing and create dmg'
condition: ne(variables['Build.Reason'], 'PullRequest')
- script: |
osx/createbundle.sh $(Build.ArtifactStagingDirectory)/ThymioSuite-$(packet_version)-OsX-12-15.dmg build/bin
displayName: 'Create Unsigned DMG'
condition: eq(variables['Build.Reason'], 'PullRequest')
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'ThymioSuite.dmg'
- job: BuildForIOs
pool:
vmImage: 'macOS-10.14'
steps:
- task: NodeTool@0
inputs:
versionSpec: '9.x'
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'certificat-IOS.p12'
certPwd: $(mobsya-mac-p12)
- task: InstallAppleProvisioningProfile@1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'Ios2020dist.mobileprovision'
removeProfile: true
- script: |
curl -sL $(blockly_url) | tar xzf - -C .
curl -sL $(scratch_url) | tar xzf - -C .
curl -sL $(vpl3_url) | tar xzf - -C .
displayName: 'Extract scratch, blockly and vpl3'
#we need 7z to extract qt so brew needs to run first
#workaround until devops deploy
- script: |
brew uninstall [email protected]
brew untap local/openssl
brew bundle
displayName: 'Install dependencies with HomeBrew'
- script: |
curl -sL https://github.com/Mobsya/ci-data/releases/download/data/qt-5.15.2-ios.7z --output ios.7z
7z x ios.7z
displayName: 'Download Qt 5.15.2 for ios'
- script: |
git submodule update --init --recursive
displayName: 'Clone submodules'
- script: |
sudo xcode-select -s /Applications/Xcode_11.3.1.app/Contents/Developer
mkdir build && cd build;
mkdir flatc && cd flatc;
cmake ../../third_party/flatbuffers -GXcode
cmake --build . --config Release --target flatc
export FLATC=`pwd`/Release/flatc
cd ..
cmake -DIOS_ARCH="arm64" -DENABLE_BITCODE=NO -DIOS_DEPLOYMENT_TARGET=11.0 -DCMAKE_TOOLCHAIN_FILE=../ios/ios-cmake/ios.toolchain.cmake -DCMAKE_PREFIX_PATH="`pwd`/../Qt/5.15.2/ios/" -G Xcode -DIOS_ARCHIVE_BUILD=1 ..
displayName: 'CONFIGURE with cmake'
- script: |
cd build;
cmake --build . --target thymio-launcher --config Release -- -IPHONEOS_DEPLOYMENT_TARGET=11.0 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO;
xcodebuild -scheme thymio-launcher -configuration Release -derivedDataPath ./bin/datas/libraries -sdk iphoneos clean archive -archivePath ./bin/launcher.xcarchive -IPHONEOS_DEPLOYMENT_TARGET=11.0 -allowProvisioningUpdates CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO;
displayName: 'Build with cmake - Unsigned'
condition: eq(variables['Build.Reason'], 'PullRequest')
- script: |
cd build;
cmake --build . --target thymio-launcher --config Release -- -IPHONEOS_DEPLOYMENT_TARGET=11.0
xcodebuild -scheme thymio-launcher -configuration Release -derivedDataPath ./bin/datas/libraries -sdk iphoneos clean archive -archivePath ./bin/launcher.xcarchive -IPHONEOS_DEPLOYMENT_TARGET=11.0 PROVISIONING_PROFILE_SPECIFIER="Ios-2020-dist" CODE_SIGN_IDENTITY="iPhone Distribution" CODE_SIGN_STYLE="Manual"
xcodebuild -exportArchive -archivePath ./bin/launcher.xcarchive -exportOptionsPlist ../ios/exportOptions.plist -exportPath $(Build.ArtifactStagingDirectory)
displayName: 'Build with cmake - SIGNED'
condition: ne(variables['Build.Reason'], 'PullRequest')
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'ThymioSuite.app'