-
Notifications
You must be signed in to change notification settings - Fork 2
804 lines (706 loc) · 27.1 KB
/
ci.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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
---
name: "CI: Test, Build and create release"
# yamllint disable
on:
# yamllint enable
push:
branches:
- main
- develop
tags:
- "[0-9]+.[0-9]+.[0-9]+"
paths:
- "**.cpp"
- "**.h"
- "**.hpp"
- "**.py"
- cmake/**
- src/**
- CMakeLists.txt
- conanfile.py
- ".github/workflows/ci.yml"
- "deploy/flatpak.yaml"
- "snap/snapcraft.yaml"
pull_request:
# The branches below must be a subset of the branches above
types: [ opened, synchronize, reopened ]
paths:
- "**.cpp"
- "**.h"
- "**.hpp"
- "**.py"
- cmake/**
- src/**
- CMakeLists.txt
- conanfile.py
- ".github/workflows/ci.yml"
- "deploy/flatpak.yaml"
- "snap/snapcraft.yaml"
workflow_dispatch:
env:
# Target
TARGET_NAME: jmbde
PROJECT_NAME: jmbde-QT
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
CLANG_TIDY_VERSION: "13.0.0"
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
QT_VERSION: "6.4.1"
QT_TARGET: "desktop"
jobs:
# format
clang-format:
name: "💎 CLang-Format"
runs-on: ubuntu-latest
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "🟨 Use clang-format"
uses: DoozyX/[email protected]
with:
source: "."
exclude: "./third_party ./external"
extensions: "c,h,cpp,hpp"
clangFormatVersion: 14
inplace: true
- uses: EndBug/add-and-commit@v9
with:
author_name: Clang Robot
author_email: [email protected]
message: ":art: Committing clang-format changes"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cmake-format:
name: "💎 CMake-Format"
runs-on: ubuntu-latest
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0
- name: "🟨 Setup Python"
uses: actions/setup-python@v5
with:
# Read python version from a file .python-version
python-version-file: ".python-version"
# check-latest: true
cache: pip
- name: "🟨 Install cmakelang"
uses: BSFishy/pip-action@v1
with:
packages: cmakelang pyyaml jinja2
- name: "🟨 Use cmake-format"
run: find . \( -name '*.cmake' -o -name 'CMakeLists.txt' \) -exec cmake-format -i {} \;
- name: "📨 Use Commit"
uses: EndBug/add-and-commit@v9
with:
author_name: github_actions
message: ":art: Committing format changes"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# lint:
# tests:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# Recommendations:
# * support at least 2 operating systems
# * support at least 2 compilers
# * make sure all supported configurations for your project are built
#
# Disable/enable builds in this list to meet the above recommendations
# and your own projects needs
matrix:
os: [ ubuntu-latest, ubuntu-22.04 ]
generator:
- "Ninja"
build_type:
- Debug
qt_version: [ 5.15.2, 6.4.0 ]
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "Cancel Previous Runs"
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "⚙️ Install Python"
id: python
uses: actions/setup-python@v5
with:
# Read python version from a file .python-version
python-version-file: ".python-version"
# check-latest: true
cache: pip
- name: "'⚙️ Install Python dependencies"
shell: bash
id: python-deps
run: |
python -m pip install --upgrade pip
pip3 install "conan<2"
- name: "🐧 ⚙️ Install Linux dependencies"
if: runner.os == 'Linux'
run: |
sudo apt-get update && DEBIAN_FRONTEND=--noninteractive \
sudo apt-get --no-install-recommends --assume-yes install \
libclang-dev \
ninja-build \
gcovr \
ccache \
cppcheck \
googletest
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
echo "CC=gcc-10" >> $GITHUB_ENV
- name: Configure Conan
shell: bash
run: |
echo "Setup conan"
conan user
conan config init
conan profile show default
- name: "🔧 Setup Cache"
uses: ./.github/actions/setup_cache
with:
build_type: ${{ matrix.build_type }}
generator: ${{ matrix.generator }}
- name: "⚙️ Install Qt Version ${{ matrix.qt_version }}"
uses: jurplel/install-qt-action@v4
with:
version: "${{ matrix.qt_version }}"
dir: "${{ env.QT_DIR }}"
# host: ${{ runner.os }}
arch: "${{ env.QT_ARCH }}"
target: "${{ env.QT_TARGET }}"
tools: "${{ env.QT_TOOLS }}"
setup-python: "true"
cache: "true"
cache-key-prefix: "${{ runner.os }}-install-qt-action"
set-env: "true"
install-deps: "true"
- uses: hendrikmuhs/ccache-action@v1
if: runner.os == 'Linux'
with:
key: ${{ matrix.os }}-${{ matrix.build_type }}
max-size: 50M
- name: restore ccache
uses: pat-s/[email protected]
with:
path: ${{runner.workspace}}/ccache
key: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}-${{ github.sha }}
restore-keys: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}
- name: check ccache stats prior to build
run: ccache --zero-stats --show-stats
- name: "Cleanup Conan system packages (they are not properly cached)"
run: |
conan remove -f '*/system'
- name: "Add GCC problem matcher"
uses: ammaraskar/gcc-problem-matcher@master
- name: "Create Build Environment"
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory build
# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results
- name: "Configure CMake"
working-directory: build
shell: bash
run: |
mkdir -pv usr
cmake -S .. -B . -G "${{matrix.generator}}" \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \
-DCMAKE_INSTALL_PREFIX:PATH="./usr" \
-DOPT_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} \
-DBUILD_TESTING:BOOL=${{ matrix.build_type == 'Debug' }} \
-DENABLE_CACHE="ON"
- name: "🚧 Build"
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: check ccache stats prior to build
run: ccache --zero-stats --show-stats
- name: "🐧 🧪 Test and coverage"
working-directory: build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
ctest -C ${{matrix.build_type}}
gcovr -j ${{env.nproc}} --delete --root ../ --print-summary --xml-pretty --xml coverage.xml
- name: "Publish to codecov"
uses: codecov/codecov-action@v5
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml
build:
# if: startsWith(github.event.ref, 'refs/tags/')
name: "Build for ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
needs: tests
strategy:
fail-fast: false
matrix:
name:
[
ubuntu-latest-clang++,
macos-latest-clang++,
windows-latest-cl.exe
]
include:
- name: ubuntu-latest-clang++
os: ubuntu-latest
build_type: Release
qt_arch: gcc_64
compiler: clang++-14
ccompiler: clang-14
clang-tidy: ""
generators: Ninja
- name: windows-latest-cl.exe
os: windows-latest
build_type: Release
qt_arch: win64_msvc2019_64
arch: x64
pak_arch: win64
compiler: cl.exe
ccompiler: cl.exe
clang-tidy: ""
generators: Ninja
- name: macos-latest-clang++
os: macos-latest
build_type: Release
qt_arch: clang_64
arch: clang_64
compiler: clang++
ccompiler: clang
generators: Ninja
env:
CXX: ${{ matrix.compiler }}
CC: ${{ matrix.ccompiler }}
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "⚙️ Get the version"
id: get_version
shell: bash
run: |
echo ::set-output name=VERSION::"$(echo $GITHUB_REF | cut -d / -f 3)"
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "⚙️ Install Python"
id: python
uses: actions/setup-python@v5
with:
# Read python version from a file .python-version
python-version-file: ".python-version"
# check-latest: true
cache: pip
- name: "⚙️ Install Python dependencies"
shell: bash
id: python-deps
run: |
python -m pip install --upgrade pip
pip3 install "conan<2"
- name: "🔧 Setup Cache"
uses: ./.github/actions/setup_cache
with:
build_type: ${{ matrix.build_type }}
generator: ${{ matrix.generator }}
- name: "🐧 ⚙️ Install Linux dependencies"
if: runner.os == 'Linux'
run: |
sudo apt-get update && DEBIAN_FRONTEND=--noninteractive \
sudo apt-get --no-install-recommends --assume-yes install \
libclang-dev \
ninja-build \
ccache
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "CC=clang-12" >> $GITHUB_ENV
- name: "⚙️ 🍎 Install macos dependencies"
if: runner.os == 'macOS'
env:
HOMEBREW_NO_ANALYTICS: "ON"
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
run: |
brew install ninja ccache pkg-config
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
# Use latest available XCode
sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
echo "DEVELOPER_DIR=/Applications/Xcode_13.2.1.app/Contents/Developer" >> $GITHUB_ENV
- name: "🧊 ⚙️ Install Windows dependencies"
if: runner.os == 'Windows'
run: |
cinst ninja ccache
- name: "🧊 ⚙️ Configure MSVC"
if: runner.os == 'Windows'
uses: ilammy/[email protected]
with:
# 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo
toolset: 14.2
arch: ${{ matrix.confg.pak_arch }}
- name: Configure Conan
shell: bash
run: |
echo "Setup conan"
conan user
conan config init
conan profile show default
- name: (Linux/macOS) restore ccache
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: pat-s/[email protected]
with:
path: ${{runner.workspace}}/ccache
key: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}-${{ github.sha }}
restore-keys: ccache-${{matrix.os}}-${{matrix.compiler}}-${{matrix.qt}}
- name: (Linux/macOS) check ccache stats prior to build
if: runner.os == 'Linux' || runner.os == 'macOS'
run: ccache --zero-stats --show-stats
- name: "Add GCC problem matcher"
if: runner.os == 'Linux'
uses: ammaraskar/gcc-problem-matcher@master
- name: "⚙️ Install Qt Version ${{ env.QT_VERSION }}"
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
# host: ${{ runner.os }}
target: ${{ env.QT_TARGET }}
arch: ${{ matrix.config.qt_arch }}
dir: "${{ github.workspace }}/build/"
install-deps: "true"
# modules: 'qtcharts qtwebengine'
cached: "${{ steps.cache-qt.outputs.cache-hit }}"
setup-python: "true"
# tools: "tools_ifw"
set-env: "true"
- name: "Cleanup Conan system packages (they are not properly cached)"
run: |
conan remove -f '*/system'
- name: "Create Build Environment"
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory build
# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results
- name: "⚙️ 🧊 Configure CMake"
if: runner.os == 'Windows'
working-directory: build
shell: pwsh
run: |
cmake `
-S .. -B . `
-G "${{matrix.generators}}" `
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} `
-DCMAKE_INSTALL_PREFIX:PATH="${{github.workspace}}/install" `
-DBUILD_SHARED_LIBS:BOOL="TRUE"
# -G "Visual Studio 16 2019" -A "x64" `
# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results.
- name: "⚙️ 🐧 Configure CMake"
if: runner.os == 'Linux'
working-directory: build
shell: bash
run: |+
cmake -S .. -B . -G "${{matrix.generator}}" \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \
-DCMAKE_INSTALL_PREFIX:PATH="${{github.workspace}}/AppDir/usr" \
-DBUILD_SHARED_LIBS:BOOL="TRUE" \
-DENABLE_CACHE="ON"
- name: "⚙️ 🍎 Configure CMake"
working-directory: build
shell: bash
if: runner.os == 'macOS'
run: |+
cmake -S .. -B . -G "${{matrix.generator}}" \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \
-DCMAKE_INSTALL_PREFIX:PATH="${{github.workspace}}/install" \
-DBUILD_SHARED_LIBS:BOOL="TRUE" \
-DENABLE_CACHE="ON"
# TODO: Stored in install. Build DMG with CPack
- name: "📦 🍎 Build and package application (macdeployqt and zipfile)"
working-directory: build
if: runner.os == 'macOS'
run: |
cmake --build . --config ${{matrix.build_type}}
cpack -C "${{matrix.build_type}}" -G "DragNDrop;ZIP"
# TODO: Stored in install. Build installer with CPack
- name: "⚙️ 🧊 Build"
if: runner.os == 'Windows'
working-directory: build
run: |
cmake --build . --config ${{matrix.build_type}}
cpack -C "${{matrix.build_type}}" -G "WIX;ZIP"
- name: "⚙️ 🐧 Build"
if: runner.os == 'Linux'
working-directory: build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
sudo apt-get -y --no-install-recommends install tree
cmake --build . --config ${{matrix.build_type}} --target install
- name: "⚙️ 🐧 Install go-appimage tool"
if: runner.os == 'Linux'
# Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution,
# which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
# Will try new tool https://github.com/probonopd/go-appimage written in golang by probonopd.
run: |
wget $(curl https://api.github.com/repos/probonopd/go-appimage/releases | jq -r '.[] | select(.tag_name == "continuous") | .assets[] | select((.name | endswith("x86_64.AppImage")) and (.name | contains("appimagetool"))) | .browser_download_url') -O appimagetool
chmod +x appimagetool
env:
APPIMAGETOOL_ARCH: x86_64
# TODO: Stored in build directory
- name: "🐧 📦 Create AppImage"
if: runner.os == 'Linux'
shell: bash
run: |
APPIMAGE_DST_PATH="${{github.workspace}}/AppDir"
cd $GITHUB_WORKSPACE
cp $GITHUB_WORKSPACE/assets/icons/icons8-app-symbol-80.png $APPIMAGE_DST_PATH/io.github.jmuelbert.${TARGET_NAME}.png
$GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/io.github.jmuelbert.${TARGET_NAME}.desktop
mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
if [ -f "${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0" ]; then
rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0
fi
chmod +x ${APPIMAGE_DST_PATH}/usr/lib64/ld-*.so.*
$GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
- name: "🐧 📤 Upload Linux artifacts"
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: AppImage
path: "./*.AppImage*"
- name: "🍎 📤 Upload macOS artifacts"
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: |
build/*.dmg
build/*.zip
- name: "🧊 📤 Upload artifact: Windows Installer"
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
build/*.msi
build/*.zip
flatpak-build:
name: "🐧 Build flatpak on ubuntu-latest"
runs-on: ubuntu-latest
needs: tests
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "⚙️ Get the version"
id: get_version
shell: bash
run: echo ::set-output name=VERSION::"$(echo $GITHUB_REF | cut -d / -f 3)"
- name: "Cancel Previous Runs"
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "Setup Flatpak"
run: |
sudo apt-get -y -qq update
sudo apt-get install -y flatpak flatpak-builder
- name: "Setup Flatpak"
run: |
sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
apt-get --no-install-recommends --assume-yes install \
flatpak flatpak-builder elfutils
- name: "Setup Flathub"
run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: "📦 Create flatpak"
run: |
mkdir -pv $GITHUB_WORKSPACE/install
BUNDLE="io.github.jmuelbert.${{env.TARGET_NAME}}.flatpak"
MANIFEST_PATH=$GITHUB_WORKSPACE/deploy/flatpak.yaml
RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
APP_ID="io.github.jmuelbert.${{env.TARGET_NAME}}"
flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub
flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID}
mv $GITHUB_WORKSPACE/$BUNDLE $GITHUB_WORKSPACE/io.github.jmuelbert.${{env.TARGET_NAME}}_${{ steps.get_version.outputs.VERSION }}.x86_64.flatpak
ls -al
- name: "📤 Upload artifact: FlatPak"
uses: actions/upload-artifact@v4
with:
name: flatpak-artifact
path: |
./install/*.flatpak
snap-build:
name: "🐧 Build snap on ubuntu-20.04"
runs-on: ubuntu-20.04
needs: tests
steps:
- name: "⚙️ Get the version"
id: get_version
shell: bash
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Cancel Previous Runs"
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "📦 Create snap"
uses: snapcore/action-build@v1
id: snapcraft
with:
snapcraft-args: --enable-experimental-extensions
- name: "Rename snap name"
shell: bash
run: |
mv ${{ steps.snapcraft.outputs.snap }} $GITHUB_WORKSPACE/${TARGET_NAME}_${{ steps.get_version.outputs.VERSION }}_amd64.snap
ls
- name: "🐧 📤 Upload artifact: SnapPack"
uses: actions/upload-artifact@v4
with:
name: snapcraft-artifact
path: |
$GITHUB_WORKSPACE/${{ env.TARGET_NAME}}_*_amd64.snap
diagram:
name: "Build diagram"
needs: tests
runs-on: ubuntu-latest
steps:
- name: "🧰 Checkout"
uses: actions/checkout@master
- name: "Update diagram"
uses: githubocto/[email protected]
with:
output_file: "images/diagram.svg"
excluded_paths: "dist,node_modules"
releaseNotes:
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: upload
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: "Build Releasenotes"
id: github_releasenotes
uses: release-drafter/[email protected]
with:
publish: "${{ steps.check-version.outputs.tag != '' }}"
tag: "${{ steps.check-version.outputs.tag }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
changeLog:
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: upload
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release
with:
body: ${{steps.github_release.outputs.changelog}}
# Upload continous build
upload:
name: "🗂 Create release and upload artifacts"
needs:
- build
- flatpak-build
- snap-build
runs-on: ubuntu-latest
steps:
- name: "📥 Download artifacts"
uses: actions/download-artifact@v4
- name: "🗂 Inspect directory after downloading artifacts"
run: ls -alFR
- name: "📤 Upload Release: AppImage"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{runner.workspace}}/${{env.TARGET_NAME}}.appimage
asset_name: ${{env.TARGET_NAME}}.appimage
tag: ${{ github.ref }}
overwrite: true
- name: "📤 Upload Release: FlatPak"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{runner.workspace}}/${{env.TARGET_NAME}}.flatpak
asset_name: ${{env.TARGET_NAME}}.flatpak
tag: ${{ github.ref }}
overwrite: true
- name: "📤 Upload Release: snap"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{runner.workspace}}/${{env.TARGET_NAME}}.amd64.snap
asset_name: ${{env.TARGET_NAME}}.amd64.snap
tag: ${{ github.ref }}
overwrite: true
- name: "📤 Upload Release: macOS"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{runner.workspace}}/${{env.TARGET_NAME}}.dmg
asset_name: ${{env.TARGET_NAME}}.dmg
tag: ${{ github.ref }}
overwrite: true
- name: "📤 Upload Release: windows"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.TARGET_NAME }}.exe
asset_name: ${{ env.TARGET_NAME}}-win.exe
tag: ${{ github.ref }}
overwrite: true
- name: "📤 Upload Release: zip for windows"
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.archiveName }}-win.zip
asset_name: ${{ env.TARGET_NAME}}-win-${{ steps.get_version.outputs.VERSION }}.zip
tag: ${{ github.ref }}
overwrite: true