-
-
Notifications
You must be signed in to change notification settings - Fork 220
720 lines (612 loc) · 23.1 KB
/
build.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
name: Build
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
branches-ignore:
- crowdin
env:
QT_VERSION: 6.6.3
QT_MODULES: qtmultimedia qtimageformats qtnetworkauth qtshadertools
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
IS_NIGHTLY: ${{ !startsWith(github.ref, 'refs/tags/v') }}
CMAKE_BUILD_PARALLEL_LEVEL: 2
QSCINTILLA_VERSION: 2.14.1
QSCINTILLA_DIR: QScintilla_src-2.14.1
ANDROID_NDK_VERSION: 25.1.8937393
jobs:
# Gatekeeper job to skip build for Crowdin PRs
gatekeeper:
name: Gatekeeper
if: startsWith(github.head_ref, 'crowdin') == false
runs-on: ubuntu-latest
steps:
- run: echo "OK"
uncrustify:
name: Uncrustify
runs-on: ubuntu-latest
needs: gatekeeper
env:
UNCRUSTIFY_COMMIT: 8edb7262e855c4271e9e5fc26af93861103e14fa
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Uncrustify cache
uses: actions/cache@v4
id: bin-cache
with:
path: bin
key: ${{ runner.os }}-uncrustify-${{ env.UNCRUSTIFY_COMMIT }}
- name: Build uncrustify
if: steps.bin-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/uncrustify/uncrustify.git uncrustify_git
cd uncrustify_git
git checkout $UNCRUSTIFY_COMMIT
cd ..
mkdir uncrustify_build
cd uncrustify_build
cmake ../uncrustify_git
cmake --build .
mkdir $GITHUB_WORKSPACE/bin
cp uncrustify $GITHUB_WORKSPACE/bin
cd ..
- name: Add bin to path
run: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Print uncrustify version
run: uncrustify -v
- name: Run uncrustify
run: ./scripts/uncrustify.sh
- name: Check diff
run: git diff --exit-code
coverage:
name: Code coverage
runs-on: ubuntu-latest
needs: gatekeeper
env:
COVERAGE: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: |
sudo apt update
sudo apt install libpulse-dev lcov libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxkbcommon-x11-0
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
- name: Build
run: |
mkdir build
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Debug -DNIGHTLY=0 -DCOMMIT="$GITHUB_SHA" -DVERSION="9.9.9"
cmake --build . --config Debug --target sites
cmake --build . --config Debug
- name: Test
working-directory: src/lib
run: |
QT_QPA_PLATFORM=offscreen ../../build/lib/tests/lib-tests
QT_QPA_PLATFORM=offscreen ../../build/cli/tests/cli-tests
- name: Test GUI
working-directory: src/lib
run: |
QT_QPA_PLATFORM=offscreen ../../build/gui/tests/gui-tests
QT_QPA_PLATFORM=offscreen ../../build/crash-reporter/tests/crash-reporter-tests
- name: Test sites
working-directory: src/sites
run: |
npm ci
npm run test
- name: Capture coverage info
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage results
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
version:
name: Version
runs-on: ubuntu-latest
needs: gatekeeper
outputs:
version: ${{ steps.get-version.outputs.version }}
release: ${{ steps.get-version.outputs.release }}
nightly: ${{ steps.get-version.outputs.nightly }}
steps:
- name: Get version
id: get-version
run: |
if [[ "$IS_RELEASE" == 'true' ]]; then echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT ; fi
if [[ "$IS_RELEASE" != 'true' ]]; then echo "version=nightly" >> $GITHUB_OUTPUT ; fi
echo "release=$([ "$IS_RELEASE" = "true" ] && echo "1" || echo "0")" >> $GITHUB_OUTPUT
echo "nightly=$([ "$IS_NIGHTLY" = "true" ] && echo "1" || echo "0")" >> $GITHUB_OUTPUT
linux:
name: Linux
runs-on: ubuntu-20.04
needs: version
env:
GRABBER_VERSION: ${{ needs.version.outputs.version }}
GRABBER_IS_NIGHTLY: ${{ needs.version.outputs.nightly }}
LINUXDEPLOYQT_VERSION: continuous
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install libpulse-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-cursor0 libxkbcommon-x11-0 libgstreamer-plugins-base1.0-0 zsync xvfb
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
- name: Vendor cache
uses: actions/cache@v4
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('.github/workflows/build.yml') }}
- name: Create vendor dir
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: mkdir vendor
- name: Build QScintilla
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
run: |
curl -Lo "QScintilla.zip" "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${QSCINTILLA_VERSION}/QScintilla_src-${QSCINTILLA_VERSION}.zip"
7z x "QScintilla.zip" -y
rm "QScintilla.zip"
cd "${QSCINTILLA_DIR}/src"
qmake qscintilla.pro
make
- name: Install QScintilla
working-directory: vendor
run: |
cd "${QSCINTILLA_DIR}/src"
make install
- name: Download linuxdeployqt
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
run: |
curl -Lo "linuxdeployqt.AppImage" "https://github.com/probonopd/linuxdeployqt/releases/download/${LINUXDEPLOYQT_VERSION}/linuxdeployqt-${LINUXDEPLOYQT_VERSION}-x86_64.AppImage"
chmod a+x linuxdeployqt.AppImage
# This driver causes an issue in linuxdeployqt because Mimer SQL is not installed but the plugin depends on it
- name: Delete unnecessary SQL driver
run: |
rm $Qt6_DIR/plugins/sqldrivers/libqsqlmimer.so
rm $Qt6_DIR/lib/cmake/Qt6Sql/Qt6QMimerSQLDriverPlugin*.cmake
- name: Build
run: |
mkdir build
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DNIGHTLY=$GRABBER_IS_NIGHTLY -DCOMMIT="$GITHUB_SHA" -DVERSION="$GRABBER_VERSION"
cmake --build . --config Release --target sites
cmake --build . --config Release
- name: Test
working-directory: src/lib
run: |
QT_QPA_PLATFORM=offscreen ../../build/lib/tests/lib-tests
QT_QPA_PLATFORM=offscreen ../../build/cli/tests/cli-tests
- name: Test GUI
working-directory: src/lib
run: |
QT_QPA_PLATFORM=offscreen ../../build/gui/tests/gui-tests
QT_QPA_PLATFORM=offscreen ../../build/crash-reporter/tests/crash-reporter-tests
- name: Generate AppImage
run: |
./scripts/package-appimage.sh
mv Grabber_*-x86_64.AppImage Grabber-x86_64.AppImage
mv Grabber_*-x86_64.AppImage.zsync Grabber-x86_64.AppImage.zsync
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: Grabber-x86_64.AppImage
path: Grabber-x86_64.AppImage
if-no-files-found: error
- name: Upload AppImage update information
uses: actions/upload-artifact@v4
with:
name: Grabber-x86_64.AppImage.zsync
path: Grabber-x86_64.AppImage.zsync
if-no-files-found: error
- name: Generate archive
run: ./scripts/package-linux.sh
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: Grabber.tar.gz
path: Grabber.tar.gz
if-no-files-found: error
macos:
name: macOS
runs-on: macos-12
needs: version
env:
GRABBER_VERSION: ${{ needs.version.outputs.version }}
GRABBER_IS_NIGHTLY: ${{ needs.version.outputs.nightly }}
OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3
CMAKE_BUILD_PARALLEL_LEVEL: 3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
- name: Vendor cache
uses: actions/cache@v4
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('.github/workflows/build.yml') }}
- name: Create vendor dir
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: mkdir vendor
- name: Build QScintilla
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
run: |
curl -Lo "QScintilla.zip" "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${QSCINTILLA_VERSION}/QScintilla_src-${QSCINTILLA_VERSION}.zip"
7z x "QScintilla.zip" -y
rm "QScintilla.zip"
cd "${QSCINTILLA_DIR}/src"
qmake qscintilla.pro
make
- name: Install QScintilla
working-directory: vendor
run: |
cd "${QSCINTILLA_DIR}/src"
make install
- name: Build
run: |
mkdir build
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Release -DNIGHTLY=$GRABBER_IS_NIGHTLY -DCOMMIT="$GITHUB_SHA" -DVERSION="$GRABBER_VERSION"
cmake --build . --config Release --target sites
cmake --build . --config Release
- name: Test
working-directory: src/lib
run: |
../../build/lib/tests/lib-tests
../../build/cli/tests/cli-tests
- name: Test GUI
working-directory: src/lib
run: |
../../build/gui/tests/gui-tests
../../build/crash-reporter/tests/crash-reporter-tests
- name: Generate package
run: ./scripts/package-mac.sh
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: Grabber.dmg
path: Grabber.dmg
if-no-files-found: error
windows:
name: Windows
runs-on: windows-2019
needs: version
env:
GRABBER_VERSION: ${{ needs.version.outputs.version }}
GRABBER_IS_NIGHTLY: ${{ needs.version.outputs.nightly }}
MYSQL_DRIVER_URL: https://github.com/thecodemonkey86/qt_mysql_driver/files/14757676/qsqlmysql.dll_Qt_SQL_driver_6.6.3_MSVC2019_64-bit.zip
OPENSSL_ROOT_DIR: ${{ github.workspace }}\vendor\OpenSSL
MYSQL_DRIVER_DIR: ${{ github.workspace }}\vendor\MySQL_driver
VCINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC
steps:
- name: Set environment
shell: bash
run: echo "BUILD_TYPE=$([ "$GRABBER_IS_NIGHTLY" = "1" ] && echo "Release" || echo "RelWithDebInfo")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
- name: Vendor cache
uses: actions/cache@v4
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('.github/workflows/build.yml') }}
- name: Create vendor dirs
if: steps.vendor-cache.outputs.cache-hit != 'true'
shell: cmd
run: mkdir vendor
- name: Build QScintilla
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
shell: cmd
run: |
curl -Lo "QScintilla.zip" "https://www.riverbankcomputing.com/static/Downloads/QScintilla/%QSCINTILLA_VERSION%/QScintilla_src-%QSCINTILLA_VERSION%.zip"
7z x "QScintilla.zip" -y
rm "QScintilla.zip"
cd "%QSCINTILLA_DIR%\src"
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" x64
qmake qscintilla.pro
nmake
- name: Install QScintilla
working-directory: vendor
shell: cmd
run: |
cd "%QSCINTILLA_DIR%\src"
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" x64
nmake install
- name: Install OpenSSL
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
shell: cmd
run: |
curl -Lo OpenSSL.exe "https://github.com/Bionus/imgbrd-grabber/releases/download/sources-master/Win64OpenSSL-3_1_4.exe" --fail
OpenSSL.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="%OPENSSL_ROOT_DIR%"
rm OpenSSL.exe
- name: Download MySQL driver
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
shell: cmd
run: |
curl -Lo "mysql_driver.zip" "%MYSQL_DRIVER_URL%"
7z x "mysql_driver.zip" -y -o"%MYSQL_DRIVER_DIR%"
rm "mysql_driver.zip"
- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake ..\src -G "Visual Studio 16 2019" -A "x64" ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_SYSTEM_VERSION=10.0.18362.0 ^
-DNIGHTLY=%GRABBER_IS_NIGHTLY% ^
-DCOMMIT="%GITHUB_SHA%" ^
-DVERSION="%GRABBER_VERSION%" ^
-DVERSION_PLATFORM="x64"
cmake --build . --config %BUILD_TYPE% --target sites
cmake --build . --config %BUILD_TYPE%
- name: Test
shell: cmd
working-directory: src/lib
run: |
..\..\build\lib\tests\%BUILD_TYPE%\lib-tests.exe
..\..\build\cli\tests\%BUILD_TYPE%\cli-tests.exe
env:
QTDIR: ${{ env.Qt6_Dir }}
QT_PLUGIN_PATH: ${{ env.Qt6_Dir }}\plugins
- name: Generate installer
shell: cmd
run: |
copy /Y "%MYSQL_DRIVER_DIR%\sqldrivers\*.dll" "%Qt6_Dir%\plugins\sqldrivers"
iscc /Q ^
/DMyAppVersion="%GRABBER_VERSION%" ^
/DPlatformName="x64" ^
/DQtDir="%Qt6_Dir%\bin" ^
/DOpenSSLDir="%OPENSSL_ROOT_DIR%" ^
/DMySQLDir="%MYSQL_DRIVER_DIR%" ^
scripts\windows-setup\setup.iss
mv scripts/windows-setup/Grabber_*.exe "Grabber_x64.exe
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: Grabber_x64.exe
path: Grabber_x64.exe
if-no-files-found: error
- name: Generate package
shell: cmd
run: scripts\package-windows.bat && mv Grabber.zip Grabber_x64.zip
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: Grabber_x64.zip
path: Grabber_x64.zip
if-no-files-found: error
- name: Generate symbols ZIP
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
shell: cmd
run: 7z a "Grabber_x64_symbols.zip" ".\build\gui\Grabber.pdb" ".\build\cli\Grabber-cli.pdb"
- name: Upload symbols
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
name: Grabber_x64_symbols.zip
path: Grabber_x64_symbols.zip
if-no-files-found: error
android:
name: Android
runs-on: ubuntu-latest
needs: version
env:
GRABBER_VERSION: ${{ needs.version.outputs.version }}
GRABBER_IS_NIGHTLY: ${{ needs.version.outputs.nightly }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: |
sudo apt update
sudo apt install libpulse-dev
- name: Install Qt (host)
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
target: desktop
arch: gcc_64
- name: Install Qt (android)
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
target: android
arch: android_armv7
- name: Install Qt (android ARM64)
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
target: android
arch: android_arm64_v8a
- name: Install Android platform and build tools
run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "platform-tools" "build-tools;33.0.0"
- name: Install Android NDK 25
run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;${ANDROID_NDK_VERSION}"
- name: Download Android OpenSSL libraries
working-directory: src/cmake
run: git clone https://github.com/KDAB/android_openssl.git
- name: Restore keystore file
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > release.jks
- name: Build
env:
QT_ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/release.jks
QT_ANDROID_KEYSTORE_ALIAS: release
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
Qt6_DIR_HOST: ${{ env.Qt6_DIR }}/../gcc_64
Qt6_DIR_V7: ${{ env.Qt6_DIR }}/../android_armv7
Qt6_DIR_V8: ${{ env.Qt6_DIR }}/../android_arm64_v8a
run: |
mkdir build
cd build
export Qt6_DIR=Qt6_DIR_V7
export ANDROID_SDK_ROOT=$ANDROID_HOME
export ANDROID_NDK_ROOT="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}"
cmake ../src -DCMAKE_BUILD_TYPE=Release -DNIGHTLY=$GRABBER_IS_NIGHTLY -DCOMMIT="$GITHUB_SHA" -DVERSION="$GRABBER_VERSION" \
-DANDROID_ABI:STRING=armeabi-v7a \
-DQT_ANDROID_ABIS:STRING="armeabi-v7a;arm64-v8a" \
-DQT_PATH_ANDROID_ABI_armeabi-v7a:PATH=$Qt6_DIR_V7 \
-DQT_PATH_ANDROID_ABI_arm64-v8a:PATH=$Qt6_DIR_V8 \
-DANDROID_NATIVE_API_LEVEL:STRING=21 \
-DANDROID_NDK:PATH=$ANDROID_NDK_ROOT \
-DANDROID_SDK:PATH=$ANDROID_HOME \
-DANDROID_STL:STRING=c++_shared \
-DQT_HOST_PATH:STRING=$Qt6_DIR_HOST \
-DQT_HOST_PATH_CMAKE_DIR:STRING=$Qt6_DIR_HOST/lib/cmake \
-DCMAKE_CXX_COMPILER:STRING=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ \
-DCMAKE_C_COMPILER:STRING=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang \
-DCMAKE_FIND_ROOT_PATH:STRING=$Qt6_DIR_V7 \
-DCMAKE_PREFIX_PATH:STRING=$Qt6_DIR_V7 \
-DCMAKE_TOOLCHAIN_FILE:PATH=$Qt6_DIR_V7/lib/cmake/Qt6/qt.toolchain.cmake \
-DQT_DEBUG_FIND_PACKAGE=ON \
-DQT_QMAKE_EXECUTABLE:STRING=$Qt6_DIR_V7/bin/qmake
cmake --build . --config Release --target sites
cmake --build . --config Release --target gui-qml_make_apk
- name: Generate package
run: |
mv build/gui-qml/android-build/build/outputs/apk/debug/android-build-debug.apk Grabber.apk 2> /dev/null || true
mv build/gui-qml/android-build/build/outputs/apk/release/android-build-release-signed.apk Grabber.apk 2> /dev/null || true
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: Grabber.apk
path: Grabber.apk
if-no-files-found: error
github:
name: Upload to GitHub releases
runs-on: ubuntu-latest
needs: [version, linux, macos, windows, android]
if: github.repository == 'Bionus/imgbrd-grabber' && github.event_name == 'push' && (needs.version.outputs.release == '1' || github.ref == 'refs/heads/develop')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Download artifact (Linux AppImage)
uses: actions/download-artifact@v4
with:
name: Grabber-x86_64.AppImage
- name: Download artifact (Linux AppImage update information)
uses: actions/download-artifact@v4
with:
name: Grabber-x86_64.AppImage.zsync
- name: Download artifact (Linux archive)
uses: actions/download-artifact@v4
with:
name: Grabber.tar.gz
- name: Download artifact (macOS)
uses: actions/download-artifact@v4
with:
name: Grabber.dmg
- name: Download artifact (Windows 64-bit installer)
uses: actions/download-artifact@v4
with:
name: Grabber_x64.exe
- name: Download artifact (Windows 64-bit archive)
uses: actions/download-artifact@v4
with:
name: Grabber_x64.zip
- name: Download artifact (Windows 64-bit symbols)
uses: actions/download-artifact@v4
if: needs.version.outputs.release == '1'
with:
name: Grabber_x64_symbols.zip
- name: Download artifact (Android)
uses: actions/download-artifact@v4
with:
name: Grabber.apk
- name: Rename artifacts
run: |
mv Grabber-x86_64.AppImage Grabber_${VERSION}-x86_64.AppImage
mv Grabber-x86_64.AppImage.zsync Grabber_${VERSION}-x86_64.AppImage.zsync
mv Grabber.tar.gz Grabber_${VERSION}.tar.gz
mv Grabber.dmg Grabber_${VERSION}.dmg
mv Grabber_x64.exe Grabber_${VERSION}_x64.exe
mv Grabber_x64.zip Grabber_${VERSION}_x64.zip
mv Grabber.apk Grabber_${VERSION}.apk
- name: Rename symbols artifacts
if: needs.version.outputs.release == '1'
run: |
mv Grabber_x64_symbols.zip Grabber_${VERSION}_x64_symbols.zip
- name: Get date for Nightly body
id: date
if: needs.version.outputs.nightly == '1'
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
- name: Nightly
uses: ncipollo/release-action@v1
if: needs.version.outputs.nightly == '1'
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
name: Nightly
allowUpdates: true
draft: false
prerelease: true
artifacts: Grabber_*
body: |
Nightly automated builds from the develop branch.
Automatically uploaded by GitHub actions, **use at your own risk**!
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- name: Release
uses: ncipollo/release-action@v1
if: needs.version.outputs.release == '1'
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
artifacts: Grabber_*