-
-
Notifications
You must be signed in to change notification settings - Fork 220
734 lines (625 loc) · 23.6 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
721
722
723
724
725
726
727
728
729
730
731
732
733
734
name: Build
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
branches-ignore:
- crowdin
env:
QT_VERSION: 5.15.2
QT_MODULES: qtnetworkauth
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
IS_NIGHTLY: ${{ !startsWith(github.ref, 'refs/tags/v') }}
CMAKE_BUILD_PARALLEL_LEVEL: 2
QSCINTILLA_VERSION: 2.13.0
QSCINTILLA_DIR: QScintilla_src-2.13.0
ANDROID_NDK_VERSION: 21.4.7075529
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@v3
with:
submodules: recursive
- name: Uncrustify cache
uses: actions/cache@v3
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@v3
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: |
xvfb-run -a ../../build/lib/tests/lib-tests
xvfb-run -a ../../build/cli/tests/cli-tests
- name: Test GUI
working-directory: src/lib
run: |
xvfb-run -a ../../build/gui/tests/gui-tests
xvfb-run -a ../../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@v3
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@v3
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 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@v3
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
- 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: |
xvfb-run -a ../../build/lib/tests/lib-tests
xvfb-run -a ../../build/cli/tests/cli-tests
- name: Test GUI
working-directory: src/lib
run: |
xvfb-run -a ../../build/gui/tests/gui-tests
xvfb-run -a ../../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@v3
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@v3
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@v3
with:
name: Grabber.tar.gz
path: Grabber.tar.gz
if-no-files-found: error
macos:
name: macOS
runs-on: macos-11
needs: version
env:
GRABBER_VERSION: ${{ needs.version.outputs.version }}
GRABBER_IS_NIGHTLY: ${{ needs.version.outputs.nightly }}
OPENSSL_ROOT_DIR: /usr/local/opt/[email protected]
CMAKE_BUILD_PARALLEL_LEVEL: 3
steps:
- name: Checkout
uses: actions/checkout@v3
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@v3
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@v3
with:
name: Grabber.dmg
path: Grabber.dmg
if-no-files-found: error
windows:
name: Windows (${{ matrix.arch }}-bit)
runs-on: windows-2019
needs: version
strategy:
fail-fast: false
matrix:
include:
- arch: 32
qt_arch: win32_msvc2019
cmake_platform: Win32
suffix: x86
- arch: 64
qt_arch: win64_msvc2019_64
cmake_platform: x64
suffix: x64
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/5575770/qsqlmysql.dll_Qt_SQL_driver_5.15.2_MSVC2019_64-bit.zip
OPENSSL_ROOT_DIR: ${{ github.workspace }}\vendor\OpenSSL
MYSQL_DRIVER_DIR: ${{ github.workspace }}\vendor\MySQL_driver
APNG_PLUGIN_DLL: ${{ github.workspace }}\vendor\APNG\plugins\imageformats\qapng.dll
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@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
arch: ${{ matrix.qt_arch }}
- name: Vendor cache
uses: actions/cache@v3
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.arch }}-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" ${{ matrix.suffix }}
qmake qscintilla.pro
nmake
- name: Install QScintilla
working-directory: vendor
shell: cmd
run: |
cd "%QSCINTILLA_DIR%\src"
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" ${{ matrix.suffix }}
nmake install
- name: Install OpenSSL
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
shell: cmd
run: |
if "${{ matrix.suffix }}"=="x86" (set "OPENSSL_PREFIX=Win32OpenSSL") else (set "OPENSSL_PREFIX=Win64OpenSSL")
curl -Lo OpenSSL.exe "https://slproweb.com/download/%OPENSSL_PREFIX%-1_1_1u.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 APNG plugin
if: steps.vendor-cache.outputs.cache-hit != 'true'
working-directory: vendor
shell: cmd
run: |
git clone https://github.com/Skycoder42/QtApng APNG
cd APNG
git checkout $(git tag | tail -1)
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" ${{ matrix.suffix }}
qmake "CONFIG += libpng_static"
nmake
- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake ..\src -G "Visual Studio 16 2019" -A "${{ matrix.cmake_platform }}" ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DNIGHTLY=%GRABBER_IS_NIGHTLY% ^
-DCOMMIT="%GITHUB_SHA%" ^
-DVERSION="%GRABBER_VERSION%" ^
-DVERSION_PLATFORM="${{ matrix.suffix }}"
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.Qt5_Dir }}
QT_PLUGIN_PATH: ${{ env.Qt5_Dir }}\plugins
- name: Generate installer
shell: cmd
run: |
copy /Y "%MYSQL_DRIVER_DIR%\sqldrivers\*.dll" "%Qt5_Dir%\plugins\sqldrivers"
iscc /Q ^
/DMyAppVersion="%GRABBER_VERSION%" ^
/DPlatformName="${{ matrix.suffix }}" ^
/DQtDir="%Qt5_Dir%\bin" ^
/DOpenSSLDir="%OPENSSL_ROOT_DIR%" ^
/DMySQLDir="%MYSQL_DRIVER_DIR%" ^
/DQtApngDll="%APNG_PLUGIN_DLL%" ^
scripts\windows-setup\setup.iss
mv scripts/windows-setup/Grabber_*.exe "Grabber_${{ matrix.suffix }}.exe
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: Grabber_${{ matrix.suffix }}.exe
path: Grabber_${{ matrix.suffix }}.exe
if-no-files-found: error
- name: Generate package
shell: cmd
run: scripts\package-windows.bat && mv Grabber.zip Grabber_${{ matrix.suffix }}.zip
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: Grabber_${{ matrix.suffix }}.zip
path: Grabber_${{ matrix.suffix }}.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_${{ matrix.suffix }}_symbols.zip" ".\build\gui\Grabber.pdb" ".\build\cli\Grabber-cli.pdb"
- name: Upload symbols
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
name: Grabber_${{ matrix.suffix }}_symbols.zip
path: Grabber_${{ matrix.suffix }}_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@v3
with:
submodules: recursive
- name: Install packages
run: |
sudo apt update
sudo apt install libpulse-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ env.QT_VERSION }}
modules: ${{ env.QT_MODULES }}
target: android
arch: android
# Necessary as Qt 5.15 depends on NDK 21 and Github Actions use NDK 25 by default
- name: Install Android NDK 21
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
cd android_openssl
git checkout f5d857ef1d437595f7c3ab0d06e61beae7ca8b99
- name: Restore keystore file
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > release.jks
- name: Build
run: |
mkdir build
cd build
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" -DKEYSTORE_PASSWORD="${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" \
-DANDROID_ABI:STRING=armeabi-v7a \
-DANDROID_BUILD_ABI_arm64-v8a:BOOL=OFF \
-DANDROID_BUILD_ABI_armeabi-v7a:BOOL=ON \
-DANDROID_BUILD_ABI_x86:BOOL=OFF \
-DANDROID_BUILD_ABI_x86_64:BOOL=OFF \
-DANDROID_NATIVE_API_LEVEL:STRING=21 \
-DANDROID_NDK:PATH=$ANDROID_NDK_ROOT \
-DANDROID_SDK:PATH=$ANDROID_HOME \
-DQT_ANDROID_NDK_ROOT:PATH=$ANDROID_NDK_ROOT \
-DQT_ANDROID_SDK_ROOT:PATH=$ANDROID_HOME \
-DANDROID_STL:STRING=c++_shared \
-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=$Qt5_DIR \
-DCMAKE_PREFIX_PATH:STRING=$Qt5_DIR \
-DCMAKE_TOOLCHAIN_FILE:PATH=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DQT_QMAKE_EXECUTABLE:STRING=$Qt5_DIR/bin/qmake
cmake --build . --config Release --target sites
cmake --build . --config Release --target gui-qml_apk
- name: Generate package
run: |
mv build/gui-qml/gui-qml-armeabi-v7a/build/outputs/apk/debug/gui-qml-armeabi-v7a-debug.apk Grabber.apk 2> /dev/null || true
mv build/gui-qml/gui-qml-armeabi-v7a/build/outputs/apk/release/gui-qml-armeabi-v7a-release-signed.apk Grabber.apk 2> /dev/null || true
- name: Upload package
uses: actions/upload-artifact@v3
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@v3
with:
name: Grabber-x86_64.AppImage
- name: Download artifact (Linux AppImage update information)
uses: actions/download-artifact@v3
with:
name: Grabber-x86_64.AppImage.zsync
- name: Download artifact (Linux archive)
uses: actions/download-artifact@v3
with:
name: Grabber.tar.gz
- name: Download artifact (macOS)
uses: actions/download-artifact@v3
with:
name: Grabber.dmg
- name: Download artifact (Windows 32-bit installer)
uses: actions/download-artifact@v3
with:
name: Grabber_x86.exe
- name: Download artifact (Windows 32-bit archive)
uses: actions/download-artifact@v3
with:
name: Grabber_x86.zip
- name: Download artifact (Windows 32-bit symbols)
uses: actions/download-artifact@v3
if: needs.version.outputs.release == '1'
with:
name: Grabber_x86_symbols.zip
- name: Download artifact (Windows 64-bit installer)
uses: actions/download-artifact@v3
with:
name: Grabber_x64.exe
- name: Download artifact (Windows 64-bit archive)
uses: actions/download-artifact@v3
with:
name: Grabber_x64.zip
- name: Download artifact (Windows 64-bit symbols)
uses: actions/download-artifact@v3
if: needs.version.outputs.release == '1'
with:
name: Grabber_x64_symbols.zip
- name: Download artifact (Android)
uses: actions/download-artifact@v3
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_x86.exe Grabber_${VERSION}_x86.exe
mv Grabber_x86.zip Grabber_${VERSION}_x86.zip
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_x86_symbols.zip Grabber_${VERSION}_x86_symbols.zip
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_*