-
-
Notifications
You must be signed in to change notification settings - Fork 27
executable file
·725 lines (637 loc) · 28.6 KB
/
build_cmake.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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# Copyright (C) 2004-2024 Robert Griebl
# SPDX-License-Identifier: GPL-3.0-only
name: CMake Build Matrix
env:
BUILD_NUMBER: ${{ github.run_number }}
BRICKSTORE_QT6_DEB_PACKAGES: >-
build-essential cmake ninja-build
libglvnd-dev libtbb-dev
qt6-tools-dev qt6-tools-dev-tools
qt6-l10n-tools qt6-documentation-tools
qt6-base-dev qt6-base-private-dev qt6-base-dev-tools
qt6-qpa-plugins
BRICKSTORE_GUI_QT6_DEB_PACKAGES: >-
libsecret-1-dev libcups2-dev
qt6-declarative-dev qt6-declarative-private-dev
qt6-quick3d-dev qt6-quick3d-dev-tools qt6-shadertools-dev
qt6-gtk-platformtheme libqt6svg6-dev qt6-multimedia-dev
qt6-image-formats-plugins
qml6-module-qt5compat-graphicaleffects qml6-module-qtmultimedia
qml6-module-qtqml-workerscript qml6-module-quick3d
BRICKSTORE_GUI_QT6_INSTALLER_MODULES: >-
qtquick3d qtshadertools qtquicktimeline qt5compat qtimageformats qtmultimedia
on:
workflow_dispatch:
push:
branches:
- main
- next
tags:
- v*
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runs-on }}
outputs:
snap-file: ${{ steps.create-snap.outputs.snap || '' }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows Intel 64bit"
artifact: "Windows-x64"
runs-on: windows-2022
os: windows
qt_host: 'windows'
qt_version: '6.8.1'
qt_arch: 'win64_msvc2022_64'
qt_dir: "msvc2022_64"
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake_extra_config: '-DSENTRY=ON'
- name: "Windows ARM 64bit"
artifact: "Windows-ARM64"
runs-on: windows-2022
os: windows
qt_host: 'windows'
qt_host_arch: 'win64_msvc2022_64'
qt_version: '6.8.1'
qt_arch: 'win64_msvc2022_arm64_cross_compiled'
qt_dir: "msvc2022_arm64"
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvarsamd64_arm64.bat"
cmake_extra_config: '-DCMAKE_TOOLCHAIN_FILE=%Qt6_DIR%/lib/cmake/Qt6/qt.toolchain.cmake -DQT_HOST_PATH=%Qt6_DIR%/../msvc2022_64'
- name: "Ubuntu 24.04"
artifact: "Ubuntu-24.04"
runs-on: ubuntu-22.04
os: linux
debian_container: "buildpack-deps:24.04"
- name: "Debian 12 Backend"
artifact: "Debian-12-Backend"
runs-on: ubuntu-22.04
os: linux
debian_container: "buildpack-deps:trixie"
cmake_extra_config: "-DBACKEND_ONLY=ON"
generate_docs: true
generate_docker: true
- name: "Linux AppImage"
artifact: "Linux-AppImage"
runs-on: ubuntu-22.04
os: linux
appimage: true
qt_tools: tools_opensslv3_src
qt_host: 'linux'
qt_version: '6.8.1'
qt_arch: 'linux_gcc_64'
qt_dir: 'gcc_64'
- name: "Ubuntu Snap"
artifact: "Linux-Snap"
runs-on: ubuntu-22.04
os: linux
snap: true
qt_tools: tools_opensslv3_src
qt_host: 'linux'
qt_version: '6.8.1'
qt_arch: 'linux_gcc_64'
qt_dir: 'gcc_64'
- name: "Linux Flatpak"
artifact: "Linux-Flatpak"
runs-on: ubuntu-22.04
os: linux
flatpak: true
qt_tools: tools_opensslv3_src
qt_host: 'linux'
qt_version: '6.8.1'
qt_arch: 'linux_gcc_64'
qt_dir: 'gcc_64'
- name: "macOS Universal"
artifact: "macOS"
runs-on: macos-13
os: macos
qt_host: 'mac'
qt_version: '6.8.1'
qt_arch: 'clang_64'
qt_dir: 'macos'
cmake_extra_config: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DSENTRY=ON'
xcode: '15.1' # https://developer.apple.com/forums/thread/740889
- name: "macOS 10 Legacy"
artifact: "macOS-10-Legacy"
runs-on: macos-13
os: macos
qt_host: 'mac'
qt_version: '6.4.3'
qt_arch: 'clang_64'
qt_dir: 'macos'
cmake_extra_config: '-DCMAKE_OSX_ARCHITECTURES="x86_64"'
- name: "Android"
artifact: "Android"
runs-on: ubuntu-24.04
os: android
android_abi: 'arm64-v8a'
android_ndk: '26.3.11579264'
qt_host: 'linux'
qt_host_arch: 'linux_gcc_64'
qt_target: 'android'
qt_version: '6.7.3'
qt_arch: 'android_x86_64'
qt_extra_archs: 'android_arm64_v8a android_armv7 android_x86'
cmake_extra_config: '-DSENTRY=ON'
- name: "iOS"
artifact: "iOS"
runs-on: macos-13
os: ios
qt_host: 'mac'
qt_host_arch: 'clang_64'
qt_target: 'ios'
qt_version: '6.7.3'
qt_arch: 'ios'
cmake_extra_config: ''
xcode: '15.2'
# BUILD
#################################################
steps:
# Checkout
#################################################
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Get Qt
#################################################
- name: Cache Qt from aqtinstall
id: cache-qt
if: (matrix.config.os != 'linux') || matrix.config.appimage || matrix.config.snap || matrix.config.flatpak
uses: actions/cache@v4
with:
path: "${{ runner.workspace }}/Qt/"
key: "Qt-${{ matrix.config.qt_version }}-${{ matrix.config.qt_host }}-${{ matrix.config.qt_arch }}"
- name: "Fix Python version"
if: matrix.config.appimage
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Qt via aqtinstall
if: |
((matrix.config.os != 'linux') || matrix.config.appimage || matrix.config.snap || matrix.config.flatpak)
&& (steps.cache-qt.outputs.cache-hit != 'true')
shell: sh
run: |
python3 -m pip install aqtinstall
# python3 -m pip install git+https://github.com/miurahr/aqtinstall@master
if [ "${{ matrix.config.qt_host_arch }}" != "" ]; then
python3 -m aqt -c .github/aqt-settings.ini install-qt -O "${{ runner.workspace }}/Qt/" \
${{ matrix.config.qt_host }} desktop \
${{ matrix.config.qt_version }} ${{ matrix.config.qt_host_arch }} \
-m $BRICKSTORE_GUI_QT6_INSTALLER_MODULES
fi
for arch in ${{ matrix.config.qt_arch }} ${{ matrix.config.qt_extra_archs }}; do
python3 -m aqt -c .github/aqt-settings.ini install-qt -O "${{ runner.workspace }}/Qt/" \
${{ matrix.config.qt_host }} ${{ matrix.config.qt_target || 'desktop' }} \
${{ matrix.config.qt_version }} $arch \
-m $BRICKSTORE_GUI_QT6_INSTALLER_MODULES
if [ "${{ matrix.config.qt_tools }}" != "" ]; then
python3 -m aqt -c .github/aqt-settings.ini install-tool -O "${{ runner.workspace }}/Qt/" \
${{ matrix.config.qt_host }} ${{ matrix.config.qt_target || 'desktop' }} \
${{ matrix.config.qt_tools }}
fi
done
- name: Install Qt via aqtinstall (finalize)
if: |
((matrix.config.os != 'linux') || matrix.config.appimage || matrix.config.snap || matrix.config.flatpak)
shell: sh
run: |
# Set and export Qt6_DIR
if [ "${{ matrix.config.os }}" = "windows" ]; then
export Qt6_DIR="${{ runner.workspace }}\\Qt\\${{ matrix.config.qt_version }}\\${{ matrix.config.qt_dir || matrix.config.qt_arch }}"
else
export Qt6_DIR="${{ runner.workspace }}/Qt/${{ matrix.config.qt_version }}/${{ matrix.config.qt_dir || matrix.config.qt_arch }}"
fi
echo "Qt6_DIR=$Qt6_DIR" >> $GITHUB_ENV
# Fix broken Windows / ARM64 setup
if [ "${{ matrix.config.qt_arch }}" = "win64_msvc2022_arm64_cross_compiled" ]; then
# Qt < 6.5.0
sed -i "s,/Users/qt/work/install/,`echo -E ${Qt6_DIR} | tr '\\' '/'`/../msvc2022_64/," "${Qt6_DIR}/bin/qtpaths.bat"
sed -i "s,/Users/qt/work/install/,`echo -E ${Qt6_DIR} | tr '\\' '/'`/../msvc2022_64/," "${Qt6_DIR}/bin/qmake.bat"
# Qt >= 6.5.0
sed -i "s,\\\Users\\\qt\\\work\\\install\\\,`echo -E ${Qt6_DIR} | sed -e 's,\\\,\\\\\\\,g'`\\\..\\\msvc2022_64\\\," "${Qt6_DIR}/bin/qtpaths.bat"
sed -i "s,\\\Users\\\qt\\\work\\\install\\\,`echo -E ${Qt6_DIR} | sed -e 's,\\\,\\\\\\\,g'`\\\..\\\msvc2022_64\\\," "${Qt6_DIR}/bin/qmake.bat"
${Qt6_DIR}/bin/qmake.bat -query
fi
# remove all sqldrivers, except sqlite to avoid missing dependencies when packaging
find "$Qt6_DIR/plugins/sqldrivers" -type f -not -ipath "*qsqlite*" -delete
find "$Qt6_DIR/lib/cmake/Qt6Sql" -name "*DriverPlugin*" -not -name "*QSQLite*" -delete
# macOS/Windows: remove the openssl TLS plugin, as this can cause problems
case "${{ matrix.config.os }}" in
macos|windows)
find "$Qt6_DIR/plugins/tls" -type f -ipath "*qopensslbackend*" -delete
find "$Qt6_DIR/lib/cmake/Qt6Network" -name "*QTlsBackendOpenSSL*" -delete
;;
esac
- name: Install Qt from Linux Distro (container)
if: (matrix.config.os == 'linux') && matrix.config.debian_container
run: |
sudo -E docker run -v `pwd`:/brickstore -e BUILD_NUMBER --rm --name "debian-build" -d "${{ matrix.config.debian_container }}" sleep 1d
sudo docker exec -e DEBIAN_FRONTEND=noninteractive "debian-build" apt -y update
sudo docker exec -e DEBIAN_FRONTEND=noninteractive "debian-build" apt -y install \
$BRICKSTORE_QT6_DEB_PACKAGES \
$BRICKSTORE_GUI_QT6_DEB_PACKAGES \
debhelper lsb-release fakeroot build-essential
shell: bash
# Build for Windows
#################################################
- name: Build for Windows
if: (matrix.config.os == 'windows')
run: |
choco install ninja
call "${{ matrix.config.environment_script }}"
call %Qt6_DIR%\bin\qt-cmake.bat -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ matrix.config.cmake_extra_config }} -B build -S .
cmake --build build --config RelWithDebInfo --parallel --target installer --verbose
shell: cmd
- name: Upload Windows Installer
if: (matrix.config.os == 'windows')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: "build/*.exe"
- name: Upload Windows debug info to sentry.io
if: (matrix.config.os == 'windows')
run: |
curl.exe -L --output ..\\sentry-cli.exe "https://github.com/getsentry/sentry-cli/releases/latest/download/sentry-cli-Windows-i686.exe"
..\\sentry-cli.exe --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif --org brickstore --project brickstore build/bin ${Qt6_DIR}/bin
shell: cmd
# Build for Linux
#################################################
- name: Build for Linux (Debian package)
if: (matrix.config.os == 'linux') && matrix.config.debian_container
run: |
sudo docker exec -w /brickstore "debian-build" /usr/lib/qt6/bin/qt-cmake -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
${{ matrix.config.cmake_extra_config }} -B build -S .
sudo docker exec -w /brickstore "debian-build" cmake --build build --config RelWithDebInfo \
--parallel --target deb-package --verbose
shell: bash
- name: Upload Linux DEB
if: (matrix.config.os == 'linux') && matrix.config.debian_container
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: "build/*.deb"
# Build for Linux (AppImage / Snap / Flatpak)
#################################################
- name: Build for Linux (AppImage)
if: matrix.config.appimage
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -y update
sudo DEBIAN_FRONTEND=noninteractive apt -y install \
g++-10 ninja-build libglvnd-dev libtbb-dev libxkbcommon-dev libxkbcommon-x11-0 \
libxcb-\* libpulse-dev libgstreamer\*1.0-dev libsecret-1-dev libva-dev libcups2-dev libfuse2
${Qt6_DIR}/bin/qt-cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
${{ matrix.config.cmake_extra_config }} -B build -S .
cmake --build build --config RelWithDebInfo --parallel --verbose
env DESTDIR=build/BrickStore-Install cmake --install build --config RelWithDebInfo --prefix /usr
shell: bash
- name: Build for Linux (Snap / Flatpak)
if: matrix.config.snap || matrix.config.flatpak
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -y update
sudo DEBIAN_FRONTEND=noninteractive apt -y install \
g++ cmake ninja-build libglvnd-dev libtbb-dev libxkbcommon-dev libxkbcommon-x11-0 \
libxcb-\* libpulse-dev libgstreamer\*1.0-dev libsecret-1-dev libva-dev libcups2-dev
${Qt6_DIR}/bin/qt-cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
${{ matrix.config.cmake_extra_config }} -B build -S .
cmake --build build --config RelWithDebInfo --parallel --verbose
env DESTDIR=build/BrickStore-Install cmake --install build --config RelWithDebInfo --prefix /usr
shell: bash
- name: OpenSSLv3 for Linux (AppImage / Snap / Flatpak)
if: matrix.config.appimage || matrix.config.snap || matrix.config.flatpak
run: |
cd ${Qt6_DIR}/../../Tools/OpenSSLv3/src
./Configure --prefix=/usr --libdir=lib --openssldir=/etc/ssl '-Wl,-rpath,\$$ORIGIN,--enable-new-dtags'
make -j4 build_libs
make DESTDIR=${GITHUB_WORKSPACE}/build/BrickStore-Install install_runtime_libs
# Qt opens the unversioned libs first, so we need to prevent those from being
# loaded from the host system.
cd ${GITHUB_WORKSPACE}/build/BrickStore-Install/usr/lib/
for i in crypto ssl; do
rm -f lib${i}.so.1*
ln -sr lib${i}.so.3 lib${i}.so
done
shell: bash
- name: Create Linux AppImage
if: matrix.config.appimage
run: |
mkdir -p .linuxdeploy
wget -P .linuxdeploy -N "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x .linuxdeploy/linuxdeploy-x86_64.AppImage
wget -P .linuxdeploy -N "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod +x .linuxdeploy/linuxdeploy-plugin-qt-x86_64.AppImage
env VERSION=`cat VERSION_NUMBER` QML_SOURCES_PATHS=src EXTRA_QT_PLUGINS=svg \
"QMAKE=${Qt6_DIR}/bin/qmake" "LD_LIBRARY_PATH=${Qt6_DIR}/lib" \
.linuxdeploy/linuxdeploy-x86_64.AppImage \
--appdir=build/BrickStore-Install \
-l /usr/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/libva.so \
-l /usr/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/libva-drm.so \
-l /usr/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/libva-x11.so \
--plugin qt \
--output appimage
shell: bash
- name: Upload Linux AppImage
if: matrix.config.appimage
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: "*.AppImage"
- name: Create Linux Snap / Flatpak 1
if: matrix.config.snap || matrix.config.flatpak
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -y install libfuse2
wget -P .cqtdeployer -N "https://github.com/QuasarApp/CQtDeployer/releases/download/v1.6.2351/CQtDeployer_1.6.2351.ec4840f_Linux_x86_64.zip"
unzip -u .cqtdeployer/CQtDeployer_1.6.2351.ec4840f_Linux_x86_64.zip -d .cqtdeployer
chmod +x .cqtdeployer/bin/CQtDeployer
chmod +x .cqtdeployer/CQtDeployer.sh
cd build
../.cqtdeployer/CQtDeployer.sh \
-bin bin/brickstore -qmlDir ../src \
-qmake "${Qt6_DIR}/bin/qmake" \
-targetDir BrickStore-Install/usr -libOut lib -binOut bin \
-disableRunScript brickstore -disableShortCut brickstore
- name: Create Linux Flatpak 2
if: matrix.config.flatpak
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -y install flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
cd build
flatpak-builder --user --verbose --install-deps-from flathub --force-clean --repo fp-repo \
fp-build ./flatpak.yaml
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo fp-repo \
BrickStore-`cat ../VERSION_NUMBER`-`flatpak --default-arch`.flatpak \
dev.brickstore.BrickStore
- name: Upload Linux Flatpak
if: matrix.config.flatpak
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: "build/*.flatpak"
- name: Create Linux Snap 2
if: matrix.config.snap
id: create-snap
uses: snapcore/action-build@v1
with:
path: build
- name: Upload Linux Snap
if: matrix.config.snap
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: ${{ steps.create-snap.outputs.snap }}
- name: Publish to Snapcraft (edge channel)
if: matrix.config.snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.UBUNTU_SNAP_LOGIN }}
with:
snap: ${{ steps.create-snap.outputs.snap }}
release: edge
# Build for Android
#################################################
- name: Build for Android
if: (matrix.config.os == 'android')
run: |
echo "Using NDK: $ANDROID_SDK_ROOT/ndk/${{ matrix.config.android_ndk }}"
echo "QT_HOST_PATH: $(readlink -f $Qt6_DIR/../gcc_64)"
# fix build-tools 33 (dx missing)
for dir in `find $ANDROID_SDK_ROOT/build-tools/ -type d -mindepth 1`; do
if [ -e $dir/d8 ] && [ ! -e $dir/dx ]; then
sudo cp -a $dir/lib/d8.jar $dir/lib/dx.jar
sudo cp -a $dir/d8 $dir/dx
fi
done
sudo DEBIAN_FRONTEND=noninteractive apt -y update
sudo DEBIAN_FRONTEND=noninteractive apt -y install cmake ninja-build
echo "${{ secrets.ANDROID_KEYSTORE_STORE_DATA }}" | base64 --decode >android_release.keystore
export QT_ANDROID_KEYSTORE_PATH="`pwd`/android_release.keystore"
export QT_ANDROID_KEYSTORE_ALIAS="${{ secrets.ANDROID_KEYSTORE_ALIAS }}"
export QT_ANDROID_KEYSTORE_STORE_PASS="${{ secrets.ANDROID_KEYSTORE_STORE_PASS }}"
export QT_ANDROID_KEYSTORE_KEY_PASS="${{ secrets.ANDROID_KEYSTORE_KEY_PASS }}"
${Qt6_DIR}/bin/qt-cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
-D "QT_HOST_PATH=$(readlink -f $Qt6_DIR/../gcc_64)" \
-D "QT_ANDROID_TARGET_SDK_VERSION=34" \
-D "QT_ANDROID_BUILD_ALL_ABIS=TRUE" \
-D "ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk/${{ matrix.config.android_ndk }}" \
-D "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" \
-D "QT_ANDROID_SIGN_AAB=TRUE" \
-D "QT_ANDROID_MULTI_ABI_FORWARD_VARS=SENTRY" \
${{ matrix.config.cmake_extra_config }} -B build -S .
echo "Creating AAB"
cmake --build build --config Release --parallel --target final-aab --verbose
echo "Creating ARM64 APK"
cmake --build build/android_abi_builds/arm64-v8a --config Release --parallel --target final-apk --verbose
echo "Creating ARM APK"
cmake --build build/android_abi_builds/armeabi-v7a --config Release --parallel --target final-apk --verbose
echo VERSION_NUMBER="`cat VERSION_NUMBER`" >> $GITHUB_ENV
shell: bash
- name: Upload Android AAB
if: (matrix.config.os == 'android')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}-PlayStore
path: "build/*.aab"
- name: Upload Android ARM64 APK
if: (matrix.config.os == 'android')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}-ARM64
path: "build/android_abi_builds/arm64-v8a/*.apk"
- name: Upload Android ARM APK
if: (matrix.config.os == 'android')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}-ARM
path: "build/android_abi_builds/armeabi-v7a/*.apk"
- name: Upload Android AAB to the PlayStore
if: (matrix.config.os == 'android')
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
packageName: de.brickforge.brickstore
releaseFiles: build/*.aab
status: completed
track: beta
releaseName: "${{ env.VERSION_NUMBER }} (build: ${{ env.BUILD_NUMBER }})"
# Build for macOS
#################################################
- name: Import signing certificate
if: (matrix.config.os == 'macos')
env:
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.MACOS_SIGNING_CERTIFICATE_P12_DATA }}
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_SIGNING_CERTIFICATE_PASSWORD }}
run: |
exec .github/scripts/apple-import-certificate.sh
- name: Import AppStore API key
if: (matrix.config.os == 'macos')
env:
API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
API_KEY_P8_DATA: ${{ secrets.APPSTORE_API_KEY_P8_DATA }}
run: |
exec .github/scripts/apple-import-apikey.sh
- name: Set XCode version for macOS
if: (matrix.config.os == 'macos' && matrix.config.xcode)
run: |
sudo xcode-select -s /Applications/Xcode_${{ matrix.config.xcode }}.app
shell: bash
- name: Build for macOS
if: (matrix.config.os == 'macos')
run: |
${Qt6_DIR}/bin/qt-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-D "MACOS_SIGNING_IDENTITY=${{ secrets.MACOS_SIGNING_IDENTITY }}" \
${{ matrix.config.cmake_extra_config }} -B build -S .
cmake --build build --config RelWithDebInfo --parallel --target dmg --verbose
shell: bash
- name: Notarize and staple macOS DMG
if: (matrix.config.os == 'macos')
run: |
xcrun notarytool submit --wait build/BrickStore-*.dmg \
--issuer "${{ secrets.APPSTORE_API_KEY_ISSUER }}" \
--key-id "${{ secrets.APPSTORE_API_KEY_ID }}" \
--key "~/.appstoreconnect/private_keys/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8"
xcrun stapler staple -v build/BrickStore-*.dmg
shell: bash
- name: Upload macOS DMG
if: (matrix.config.os == 'macos')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: "build/*.dmg"
- name: Upload macOS debug info to sentry.io
if: (matrix.config.os == 'macos')
run: |
brew install getsentry/tools/sentry-cli
brew link getsentry/tools/sentry-cli
/usr/local/bin/sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif \
--org brickstore --project brickstore build/BrickStore.app.dSYM ${Qt6_DIR}/lib/
# Build for iOS
#################################################
# see here for a description of this setup
# https://betterprogramming.pub/deploy-an-ios-app-to-testflight-or-the-app-store-using-github-actions-c4d7082b1430
- name: Import signing certificate
if: (matrix.config.os == 'ios')
env:
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.IOS_SIGNING_CERTIFICATE_P12_DATA }}
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.IOS_SIGNING_CERTIFICATE_PASSWORD }}
run: |
exec .github/scripts/apple-import-certificate.sh
- name: Import provisioning profile
if: (matrix.config.os == 'ios')
env:
PROVISIONING_PROFILE_DATA: ${{ secrets.IOS_PROVISIONING_PROFILE_DATA }}
PROVISIONING_PROFILE_SPECIFIER: ${{ secrets.IOS_PROV_PROFILE }}
run: |
exec .github/scripts/apple-import-profile.sh
- name: Import AppStore API key
if: (matrix.config.os == 'ios')
env:
API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
API_KEY_P8_DATA: ${{ secrets.APPSTORE_API_KEY_P8_DATA }}
run: |
exec .github/scripts/apple-import-apikey.sh
- name: Set XCode version for iOS
if: (matrix.config.os == 'ios' && matrix.config.xcode)
run: |
sudo xcode-select -s /Applications/Xcode_${{ matrix.config.xcode }}.app
shell: bash
- name: Build for iOS
if: (matrix.config.os == 'ios')
run: |
${Qt6_DIR}/bin/qt-cmake -G Xcode -DCMAKE_BUILD_TYPE=Release \
-D "QT_HOST_PATH=$(readlink -f $Qt6_DIR/../macos)" \
-D "CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=${{ secrets.IOS_DEV_TEAM }}" \
-D "CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER=${{ secrets.IOS_PROV_PROFILE }}" \
-D "CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY=${{ secrets.IOS_CODE_SIGN_IDENTITY }}" \
-D "CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual" \
${{ matrix.config.cmake_extra_config }} -B build -S .
cmake --build build --config Release --parallel --target ipa --verbose
shell: bash
- name: Upload iOS IPA
if: (matrix.config.os == 'ios')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}-AppStore
path: "build/*.ipa"
- name: Upload iOS IPA to the AppStore
if: (matrix.config.os == 'ios')
run: |
xcrun altool --upload-app -f build/BrickStore-*.ipa -t ios \
--apiIssuer "${{ secrets.APPSTORE_API_KEY_ISSUER }}" \
--apiKey "${{ secrets.APPSTORE_API_KEY_ID }}"
shell: bash
# Generate documentation
#################################################
- name: Generate Documentation
if: (matrix.config.os == 'linux') && matrix.config.debian_container && matrix.config.generate_docs && (github.ref == 'refs/heads/main')
run: |
sudo docker exec -w /brickstore "debian-build" cmake --build build --target extensions-doc --verbose
- name: Publish Documentation
if: matrix.config.generate_docs && (github.ref == 'refs/heads/main')
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doc/html/extensions
destination_dir: extensions
enable_jekyll: true
# Generate the Backend Docker image
#################################################
- name: Create and push Docker image
if: (matrix.config.os == 'linux') && matrix.config.generate_docker
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
cp build/*.deb docker/brickstore-backend.deb
cd docker
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USER" --password-stdin
docker build . --tag "rgriebl/brickstore-backend:$BUILD_NUMBER"
docker push "$DOCKER_USER/brickstore-backend:$BUILD_NUMBER"
# RELEASE
#################################################
release:
needs: [ build ]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download Artifacts to Release
uses: actions/download-artifact@v4
with:
path: 'artifacts'
- name: Rename Artifacts
run: |
find artifacts -mindepth 2 -type f -print0 | while read -d $'\0' a; do
d="$(dirname $a)"
mv "$a" "${d}-$(basename $a)"
rmdir "$d" || true
done
echo "Artifacts after flattening:"
find artifacts
echo VERSION_NUMBER="`cat VERSION_NUMBER`" >> $GITHUB_ENV
shell: bash
- name: Release
uses: docker://antonyurchenko/git-release:latest
# uses: rgriebl/git-release@testing
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: artifacts/*
- name: Create release on sentry.io
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: brickstore
SENTRY_PROJECT: brickstore
with:
version: "brickstore@${{ env.BUILD_NUMBER }}"
- name: Promote Snapcraft build to stable
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.UBUNTU_SNAP_LOGIN }}
SNAPCRAFT_HAS_TTY: "true"
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -y install snapcraft
(yes || true) | snapcraft promote --from-channel edge --to-channel stable brickstore
shell: bash