forked from DonutWare/Fladder
-
Notifications
You must be signed in to change notification settings - Fork 1
768 lines (654 loc) · 26.6 KB
/
Copy pathbuild.yml
File metadata and controls
768 lines (654 loc) · 26.6 KB
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
name: Build Fladder
on:
push:
tags:
- "v*"
branches:
- master
pull_request:
paths:
- pubspec.yaml
- .github/workflows/build.yml
- .fvmrc
types:
- opened
- reopened
schedule:
# Run nightly at midnight UTC, but only if there were changes to develop
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
build_type:
description: "Build type (release, nightly)"
required: false
default: "nightly"
type: choice
options:
- release
- nightly
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NIGHTLY_TAG: nightly
jobs:
# Check if workflow should run based on trigger conditions
check-trigger:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
build_type: ${{ steps.check.outputs.build_type }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Check if should run and determine build type
id: check
run: |
# Determine build type based on trigger and input
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BUILD_TYPE="${{ github.event.inputs.build_type }}"
elif [[ "${{ startsWith(github.ref, 'refs/tags/v') }}" == "true" ]]; then
BUILD_TYPE="release"
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
# Check if there were commits to develop in the last 24 hours
git checkout develop
COMMITS_LAST_24H=$(git log --since="24 hours ago" --oneline | wc -l)
if [[ $COMMITS_LAST_24H -gt 0 ]]; then
BUILD_TYPE="nightly"
else
echo "No commits to develop in the last 24 hours, skipping nightly build"
echo "should_run=false" >> $GITHUB_OUTPUT
exit 0
fi
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BUILD_TYPE="nightly"
else
# For PRs and other events, build but don't release
BUILD_TYPE="development"
fi
echo "build_type=${BUILD_TYPE}" >> $GITHUB_OUTPUT
echo "should_run=true" >> $GITHUB_OUTPUT
echo "Build type determined: ${BUILD_TYPE}"
fetch-info:
needs: [check-trigger]
if: needs.check-trigger.outputs.should_run == 'true'
runs-on: ubuntu-latest
outputs:
version_name: ${{ steps.fetch.outputs.version_name }}
flutter_version: ${{ steps.fetch.outputs.flutter_version }}
nightly_version: ${{ steps.fetch.outputs.nightly_version }}
build_type: ${{ needs.check-trigger.outputs.build_type }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Fetch version name and create nightly version
id: fetch
run: |
# Extract version_name from pubspec.yaml
VERSION_NAME=$(grep '^version:' pubspec.yaml | cut -d ':' -f2 | cut -d '+' -f1 | tr -d ' ')
echo "version_name=${VERSION_NAME}" >> "$GITHUB_OUTPUT"
# Extract flutter_version from .fvmrc
FLUTTER_VERSION=$(jq -r '.flutter' .fvmrc)
echo "flutter_version=${FLUTTER_VERSION}" >> "$GITHUB_OUTPUT"
# Create nightly version if needed
if [[ "${{ needs.check-trigger.outputs.build_type }}" == "nightly" ]]; then
NIGHTLY_VERSION="${VERSION_NAME}-nightly"
echo "nightly_version=${NIGHTLY_VERSION}" >> "$GITHUB_OUTPUT"
echo "Nightly version: $NIGHTLY_VERSION"
fi
# Print versions for logging
echo "Base version: $VERSION_NAME"
echo "Flutter version: $FLUTTER_VERSION"
shell: bash
build-android:
needs: [fetch-info]
runs-on: ubuntu-latest
outputs:
artifact_suffix: ${{ env.ARTIFACT_SUFFIX }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Determine Build Type
run: |
echo "ARTIFACT_SUFFIX=${{ needs.fetch-info.outputs.build_type }}" >> $GITHUB_ENV
echo "ARTIFACT_SUFFIX=${{ needs.fetch-info.outputs.build_type }}" >> $GITHUB_OUTPUT
- name: Decode Keystore for release
env:
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: |
echo "$ENCODED_STRING" | base64 -d > android/app/keystore.jks
# Create the key.properties file
cat > android/app/key.properties <<EOF
storePassword=$RELEASE_KEYSTORE_PASSWORD
keyPassword=$RELEASE_KEY_PASSWORD
keyAlias=$RELEASE_KEYSTORE_ALIAS
EOF
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
check-latest: true
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies
run: flutter pub get
- name: Build Android APK and AAB
run: |
flutter build apk --release --build-number=${{github.run_number}} --flavor production
flutter build appbundle --release --build-number=${{github.run_number}} --flavor production
- name: Rename APK and AAB
run: |
mkdir -p build/app/outputs/android_artifacts
mv build/app/outputs/flutter-apk/app-production-release.apk "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.apk"
mv build/app/outputs/bundle/productionRelease/app-production-release.aab "build/app/outputs/android_artifacts/${{ env.ARTIFACT_SUFFIX }}.aab"
- name: Archive Android artifacts
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-android
path: build/app/outputs/android_artifacts/
build-windows:
runs-on: windows-2022
needs: [fetch-info]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies
run: flutter pub get
- name: Build Windows EXE
run: flutter build windows --build-number=${{ github.run_number }}
- name: Compile Inno Setup installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: windows/windows_setup.iss
options: /O+ /DFLADDER_VERSION="${{ needs.fetch-info.outputs.version_name }}"
- name: Archive Windows portable artifact
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-windows-portable
path: build\windows\x64\runner\Release\
- name: Archive Windows installer artifact
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-windows-installer
path: windows\Output\fladder_setup.exe
build-ios:
runs-on: macos-latest
needs: [fetch-info]
steps:
# - uses: maxim-lobanov/setup-xcode@v1.6.0
# with:
# xcode-version: latest-stable
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies
run: flutter pub get
- name: Build iOS app
run: flutter build ipa --no-codesign --flavor production --build-number=${{ github.run_number }}
- name: Create unsigned IPA
run: |
cd build/ios/archive/Runner.xcarchive/Products/Applications/
mkdir Payload
mv Runner.app Payload/
zip -r iOS.ipa Payload
- name: Archive iOS IPA artifact
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-iOS
path: build/ios/archive/Runner.xcarchive/Products/Applications/iOS.ipa
build-macos:
runs-on: macos-latest
needs: [fetch-info]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies
run: flutter pub get
- name: Build macOS app
run: flutter build macos --flavor production --build-number=${{ github.run_number }}
- name: Ensure correct app name casing
run: |
APP_DIR="build/macos/Build/Products/Release-production"
mv "$APP_DIR/fladder.app" "$APP_DIR/Fladder.app"
- name: Install create-dmg
run: brew install create-dmg
- name: Create DMG with custom background
run: ./scripts/create_dmg.sh
- name: Archive macOS artifact
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-macOS
path: build/macos/Build/Products/Release-production/macOS.dmg
build-linux:
runs-on: ubuntu-latest
needs: [fetch-info]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Update build number in pubspec.yaml
run: |
sed -i -E 's/(version: [0-9]+\.[0-9]+\.[0-9]+\+)[0-9]+/\1${{ github.run_number }}/' pubspec.yaml
- name: Get dependencies
run: flutter pub get
- name: Get packages
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev patchelf cmake clang libfuse2
- name: Build Linux app
run: flutter build linux --release --build-number=${{ github.run_number }}
- name: Fix RPATH
run: |
for lib in "build/linux/x64/release/bundle/lib"/*.so; do
[[ -f "$lib" && -n "$(patchelf --print-rpath "$lib")" ]] && \
patchelf --set-rpath '$ORIGIN' "$lib"
done
patchelf --set-rpath '$ORIGIN/lib' "build/linux/x64/release/bundle/Fladder"
- name: Archive Linux artifact
uses: actions/upload-artifact@v4
with:
name: fladder-linux
path: build/linux/x64/release/bundle
- name: Build AppImage
run: |
VERSION_TO_USE="${{ needs.fetch-info.outputs.version_name }}"
sed -i -E "s/(version:\\s*)latest/\\1${VERSION_TO_USE}/" AppImageBuilder.yml
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
appimage-builder --recipe AppImageBuilder.yml
- name: Archive Linux artifact
uses: actions/upload-artifact@v4
with:
name: fladder-linux-appimage
path: |
Fladder_x86_64.AppImage
Fladder_x86_64.AppImage.zsync
build-linux-flatpak:
runs-on: ubuntu-latest
if: needs.fetch-info.outputs.build_type == 'release' || needs.fetch-info.outputs.build_type == 'nightly'
needs: [fetch-info, build-linux]
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-46
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
submodules: true
- name: Download Artifacts Linux
uses: actions/download-artifact@v4
with:
name: fladder-linux
path: build/linux/x64/release/bundle
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: Fladder-Linux.flatpak
manifest-path: flatpak/nl.jknaapen.fladder.yaml
- name: Archive Linux Flatpak bundle
uses: actions/upload-artifact@v4
with:
name: fladder-linux-flatpak
path: Fladder-Linux.flatpak
build-web:
runs-on: ubuntu-latest
needs: [fetch-info]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Set up Flutter
uses: subosito/flutter-action@v2.19.0
with:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter_version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies
run: flutter pub get
- name: Build web app
run: |
flutter build web --release --build-number=${{github.run_number}}
- name: Archive web artifact
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-web
path: build/web
- name: Build Github pages web
if: needs.fetch-info.outputs.build_type == 'release'
run: flutter build web --base-href /${{ github.event.repository.name }}/ --release --build-number=$GITHUB_RUN_NUMBER
- name: Archive web pages artifact
if: needs.fetch-info.outputs.build_type == 'release'
uses: actions/upload-artifact@v4.0.0
with:
name: fladder-web-pages
path: build/web
create_release:
name: Create Release
needs:
- fetch-info
- build-android
- build-windows
- build-ios
- build-macos
- build-linux
- build-linux-flatpak
- build-web
runs-on: ubuntu-latest
if: needs.fetch-info.outputs.build_type == 'release' || needs.fetch-info.outputs.build_type == 'nightly'
permissions:
contents: write
steps:
- name: Checkout repository
if: needs.fetch-info.outputs.build_type == 'nightly'
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Set version variables
id: version
run: |
if [[ "${{ needs.fetch-info.outputs.build_type }}" == "nightly" ]]; then
echo "version=${{ needs.fetch-info.outputs.nightly_version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ needs.fetch-info.outputs.version_name }}" >> $GITHUB_OUTPUT
fi
- name: Delete existing nightly release
if: needs.fetch-info.outputs.build_type == 'nightly'
run: |
# Delete existing nightly release and tag with better error handling
echo "Checking for existing nightly release..."
if gh release view ${{ env.NIGHTLY_TAG }} >/dev/null 2>&1; then
echo "Deleting existing nightly release..."
gh release delete ${{ env.NIGHTLY_TAG }} --yes --cleanup-tag
else
echo "No existing nightly release found."
fi
# Clean up any orphaned tags
if git tag -l | grep -q "^${{ env.NIGHTLY_TAG }}$"; then
echo "Deleting orphaned nightly tag..."
git push origin --delete ${{ env.NIGHTLY_TAG }} || true
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog
if: needs.fetch-info.outputs.build_type == 'nightly'
id: changelog
run: |
# Get the latest stable release tag for comparison
LATEST_STABLE_RELEASE=$(gh release list --limit 50 --exclude-drafts --json tagName,isPrerelease --jq '.[] | select(.isPrerelease == false) | .tagName' | head -1 || echo "")
# Create new changelog with comparison link
cat > changelog.md <<-EOF
# $(date -u "+%Y-%m-%d %H:%M:%S UTC")
This is an automated nightly build containing the latest changes from the develop branch.
**⚠️ Warning:** This is a development build and may contain bugs or incomplete features.
EOF
# Add comparison link if we have a latest stable release
if [ -n "$LATEST_STABLE_RELEASE" ]; then
cat >> changelog.md <<-EOF
## 📋 What's Changed
See all changes since the latest release: [Compare $LATEST_STABLE_RELEASE...HEAD](https://github.com/${{ github.repository }}/compare/$LATEST_STABLE_RELEASE...HEAD)
EOF
else
cat >> changelog.md <<-EOF
## 📋 What's Changed
See all changes: [View commits](https://github.com/${{ github.repository }}/commits/develop)
EOF
fi
# Add build metadata
cat >> changelog.md <<-EOF
---
📅 **Build Date:** $(date -u "+%Y-%m-%d %H:%M:%S UTC")
🔧 **Build Number:** ${{ github.run_number }}
📝 **Commit:** ${{ github.sha }}
🌿 **Branch:** develop
EOF
echo "changelog_file=changelog.md" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download Artifacts Android
uses: actions/download-artifact@v4
with:
name: fladder-android
path: fladder-android
- name: Move Android
run: |
mv fladder-android/${{ needs.build-android.outputs.artifact_suffix }}.apk Fladder-Android-${{ steps.version.outputs.version }}.apk
mv fladder-android/${{ needs.build-android.outputs.artifact_suffix }}.aab Fladder-Android-${{ steps.version.outputs.version }}.aab
- name: Download Windows portable artifact
uses: actions/download-artifact@v4
with:
name: fladder-windows-portable
path: fladder-windows-portable
- name: Compress Windows
run: |
cd fladder-windows-portable
zip -r ../Fladder-Windows-${{ steps.version.outputs.version }}.zip .
- name: Download Windows installer artifact
uses: actions/download-artifact@v4
with:
name: fladder-windows-installer
path: fladder-windows-installer
- name: Rename Windows installer
run: mv fladder-windows-installer/fladder_setup.exe Fladder-Windows-${{ steps.version.outputs.version }}-Setup.exe
- name: Download Artifacts iOS
uses: actions/download-artifact@v4
with:
name: fladder-iOS
path: fladder-iOS
- name: Move iOS
run: mv fladder-iOS/iOS.ipa Fladder-iOS-${{ steps.version.outputs.version }}.ipa
- name: Download Artifacts macOS
uses: actions/download-artifact@v4
with:
name: fladder-macOS
path: fladder-macOS
- name: Move macOS
run: mv fladder-macOS/macOS.dmg Fladder-macOS-${{ steps.version.outputs.version }}.dmg
- name: Download Artifacts Linux
uses: actions/download-artifact@v4
with:
name: fladder-linux
path: fladder-linux
- name: Compress Linux
run: |
cd fladder-linux
zip -r ../Fladder-Linux-${{ steps.version.outputs.version }}.zip .
- name: Download Artifacts Linux Flatpak
if: needs.fetch-info.outputs.build_type == 'release'
uses: actions/download-artifact@v4
with:
name: fladder-linux-flatpak
path: fladder-linux-flatpak
- name: Move Linux Flatpak
if: needs.fetch-info.outputs.build_type == 'release'
run: mv fladder-linux-flatpak/Fladder-Linux.flatpak Fladder-Linux-${{ steps.version.outputs.version }}.flatpak
- name: Download Artifacts Linux AppImage
uses: actions/download-artifact@v4
with:
name: fladder-linux-appimage
path: fladder-linux-appimage
- name: Move Linux AppImages
run: |
mv fladder-linux-appimage/Fladder_x86_64.AppImage Fladder-Linux-${{ steps.version.outputs.version }}.AppImage
mv fladder-linux-appimage/Fladder_x86_64.AppImage.zsync Fladder-Linux-${{ steps.version.outputs.version }}.AppImage.zsync
- name: Download Artifacts Web
uses: actions/download-artifact@v4
with:
name: fladder-web
path: fladder-web
- name: Compress Web
run: |
cd fladder-web
zip -r ../Fladder-Web-${{ steps.version.outputs.version }}.zip .
- name: Create Release
uses: softprops/action-gh-release@v2.2.2
with:
tag_name: ${{ needs.fetch-info.outputs.build_type == 'nightly' && env.NIGHTLY_TAG || github.ref_name }}
name: ${{ needs.fetch-info.outputs.build_type == 'nightly' && format('🌙 Nightly Build - {0}', steps.version.outputs.version) || '' }}
body_path: ${{ needs.fetch-info.outputs.build_type == 'nightly' && 'changelog.md' || '' }}
draft: ${{ needs.fetch-info.outputs.build_type == 'release' }}
prerelease: ${{ needs.fetch-info.outputs.build_type == 'nightly' }}
make_latest: ${{ needs.fetch-info.outputs.build_type == 'release' }}
generate_release_notes: ${{ needs.fetch-info.outputs.build_type == 'release' }}
fail_on_unmatched_files: true
files: |
Fladder-Android-${{ steps.version.outputs.version }}.apk
Fladder-Android-${{ steps.version.outputs.version }}.aab
Fladder-Windows-${{ steps.version.outputs.version }}-Setup.exe
Fladder-Windows-${{ steps.version.outputs.version }}.zip
Fladder-iOS-${{ steps.version.outputs.version }}.ipa
Fladder-macOS-${{ steps.version.outputs.version }}.dmg
Fladder-Web-${{ steps.version.outputs.version }}.zip
Fladder-Linux-${{ steps.version.outputs.version }}.zip
Fladder-Linux-${{ steps.version.outputs.version }}.AppImage
Fladder-Linux-${{ steps.version.outputs.version }}.AppImage.zsync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add Flatpak to release
if: needs.fetch-info.outputs.build_type == 'release'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
Fladder-Linux-${{ steps.version.outputs.version }}.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_play_console:
name: Upload AAB to Google Play Console
needs:
- fetch-info
- create_release
- build-android
runs-on: ubuntu-latest
steps:
- name: Download Artifacts Android
uses: actions/download-artifact@v4
with:
name: fladder-android
path: fladder-android
- name: Upload AAB to Google Play Console
uses: r0adkll/upload-google-play@v1.1.3
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: "nl.jknaapen.fladder"
releaseFiles: "fladder-android/${{ needs.build-android.outputs.artifact_suffix }}.aab"
track: ${{ needs.fetch-info.outputs.build_type == 'nightly' && 'internal' || 'production' }}
status: ${{ needs.fetch-info.outputs.build_type == 'nightly' && 'completed' || 'draft' }}
releaseName: "${{ github.run_number }} (${{ needs.fetch-info.outputs.version_name }})"
release_web:
name: Release Web
needs:
- fetch-info
- create_release
runs-on: ubuntu-latest
if: needs.fetch-info.outputs.build_type == 'release'
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
- name: Download Artifacts Web
uses: actions/download-artifact@v4
with:
name: fladder-web
path: build/web
- name: Deploy to ghcr.io
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: fladder
addLatest: true
multiPlatform: true
platform: linux/amd64,linux/arm64,linux/arm/v7
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy rootless-image to ghcr.io
uses: mr-smithers-excellent/docker-build-push@v6
with:
dockerfile: Dockerfile-rootless
image: fladder-rootless
addLatest: true
multiPlatform: true
platform: linux/amd64,linux/arm64,linux/arm/v7
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Clean builds folder
run: rm -rf build/web
- name: Download Artifacts Web
uses: actions/download-artifact@v4
with:
name: fladder-web-pages
path: build/web
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
# Winget package submission
# winget-package-submit:
# runs-on: ubuntu-latest
# needs: [check-trigger, create_release]
# strategy:
# matrix:
# include:
# - build_type: release
# identifier: DonutWare.Fladder
# max_versions: "0"
# - build_type: nightly
# identifier: DonutWare.Fladder.Nightly
# max_versions: "1"
# steps:
# - name: Submit to Winget (${{ matrix.build_type }})
# if: needs.check-trigger.outputs.build_type == matrix.build_type
# uses: vedantmgoyal9/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f
# with:
# identifier: ${{ matrix.identifier }}
# installers-regex: 'Fladder-Windows-.*-Setup\.exe$'
# token: ${{ secrets.WINGET_TOKEN }}
# max-versions-to-keep: ${{ matrix.max_versions || '' }}
# release-tag: ${{ matrix.build_type == 'nightly' && env.NIGHTLY_TAG || github.ref_name }}