Skip to content

Commit 19a61db

Browse files
committed
ci: fix fvm and attempt to create an AppImage
1 parent 3426229 commit 19a61db

4 files changed

Lines changed: 177 additions & 78 deletions

File tree

.github/workflows/cross-platform_build.yaml

Lines changed: 95 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,45 @@ env:
99
jobs:
1010
macos:
1111
runs-on: macos-15
12-
12+
1313
steps:
14-
- uses: actions/checkout@v5
15-
16-
- run: curl -fsSL https://fvm.app/install.sh | bash
17-
18-
- run: fvm install
19-
- run: fvm flutter pub get
20-
- run: fvm dart run build_runner build --delete-conflicting-outputs
21-
- run: fvm flutter precache --macos
22-
- run: cd macos && pod install --repo-update && cd -
23-
24-
- run: fvm flutter config --enable-macos-desktop
25-
- run: fvm flutter build macos --release
26-
27-
- name: Upload macOS artifact
28-
uses: actions/upload-artifact@v4
29-
with:
30-
name: ${{ env.APP_NAME }}-macos.app
31-
path: build/macos/Build/Products/Release/${{ env.APP_NAME }}.app
14+
- uses: actions/checkout@v5
15+
16+
- name: Install FVM
17+
run: |
18+
curl -fsSL https://fvm.app/install.sh | bash
19+
echo "$HOME/fvm/bin" >> $GITHUB_PATH
20+
21+
- run: fvm install
22+
- run: fvm flutter pub get
23+
- run: fvm dart run build_runner build --delete-conflicting-outputs
24+
- run: fvm flutter precache --macos
25+
- run: cd macos && pod install --repo-update && cd -
26+
27+
- run: fvm flutter config --enable-macos-desktop
28+
- run: fvm flutter build macos --release
29+
30+
- name: Install create-dmg
31+
run: brew install create-dmg
32+
33+
- name: Create DMG
34+
run: |
35+
create-dmg \
36+
--volname "Subterfuge" \
37+
--window-pos 200 120 \
38+
--window-size 800 400 \
39+
--icon-size 100 \
40+
--icon "${{ env.APP_NAME }}.app" 200 190 \
41+
--hide-extension "${{ env.APP_NAME }}.app" \
42+
--app-drop-link 600 185 \
43+
"Subterfuge-1.2.0.dmg" \
44+
"build/macos/Build/Products/Release/${{ env.APP_NAME }}.app"
45+
46+
- name: Upload macOS DMG
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: ${{ env.APP_NAME }}-macos.dmg
50+
path: Subterfuge-1.2.0.dmg
3251

3352
android:
3453
runs-on: ubuntu-24.04
@@ -37,11 +56,15 @@ jobs:
3756
- uses: actions/checkout@v5
3857
- uses: actions/setup-java@v5
3958
with:
40-
distribution: 'temurin'
41-
java-version: '17'
42-
cache: 'gradle'
43-
- run: curl -fsSL https://fvm.app/install.sh | bash
44-
59+
distribution: "temurin"
60+
java-version: "17"
61+
cache: "gradle"
62+
63+
- name: Install FVM
64+
run: |
65+
curl -fsSL https://fvm.app/install.sh | bash
66+
echo "$HOME/fvm/bin" >> $GITHUB_PATH
67+
4568
- run: fvm install
4669
- run: fvm flutter pub get
4770
- run: fvm dart run build_runner build --delete-conflicting-outputs
@@ -55,62 +78,58 @@ jobs:
5578

5679
linux-x64:
5780
runs-on: ubuntu-24.04
58-
59-
steps:
60-
- uses: actions/checkout@v5
61-
62-
- run: sudo apt-get install build-essential libgtk-3-dev
63-
- run: curl -fsSL https://fvm.app/install.sh | bash
64-
65-
- run: fvm install
66-
- run: fvm flutter pub get
67-
- run: fvm dart run build_runner build --delete-conflicting-outputs
68-
- run: fvm flutter config --enable-linux-desktop
69-
- run: fvm flutter build linux --release --target-platform=linux-x64
70-
71-
- name: Upload Linux x64 artifact
72-
uses: actions/upload-artifact@v4
73-
with:
74-
name: ${{ env.APP_NAME }}-linux-x64
75-
path: build/linux/x64/release/bundle/${{ env.APP_NAME }}
76-
77-
linux-arm64:
78-
runs-on: ubuntu-24.04-arm
79-
81+
8082
steps:
81-
- uses: actions/checkout@v5
82-
83-
- run: sudo apt-get install build-essential libgtk-3-dev
84-
- run: curl -fsSL https://fvm.app/install.sh | bash
85-
86-
- run: fvm install
87-
- run: fvm flutter pub get
88-
- run: fvm dart run build_runner build --delete-conflicting-outputs
89-
- run: fvm flutter config --enable-linux-desktop
90-
- run: fvm flutter build linux --release --target-platform=linux-arm64
91-
92-
- name: Upload Linux arm64 artifact
93-
uses: actions/upload-artifact@v4
94-
with:
95-
name: ${{ env.APP_NAME }}-linux-arm64
96-
path: build/linux/arm64/release/bundle/${{ env.APP_NAME }}
83+
- uses: actions/checkout@v5
84+
85+
- run: sudo apt-get update
86+
- run: sudo apt-get install build-essential libgtk-3-dev
87+
88+
- name: Install FVM
89+
run: |
90+
curl -fsSL https://fvm.app/install.sh | bash
91+
echo "$HOME/fvm/bin" >> $GITHUB_PATH
92+
93+
- run: fvm install
94+
- run: fvm flutter pub get
95+
- run: fvm dart run build_runner build --delete-conflicting-outputs
96+
- run: fvm flutter config --enable-linux-desktop
97+
- run: fvm flutter build linux --release --target-platform=linux-x64
98+
99+
- name: Install appimage-builder dependencies
100+
run: sudo apt install -y binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-setuptools squashfs-tools strace util-linux zsync
101+
102+
- name: Install appimage-builder
103+
run: |
104+
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
105+
chmod +x appimage-builder-x86_64.AppImage
106+
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
107+
108+
- name: Build AppImage
109+
run: appimage-builder --recipe appimage_builder_x64.yml --skip-test
110+
111+
- name: Upload Linux x64 AppImage
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: ${{ env.APP_NAME }}-linux-x64.AppImage
115+
path: "*.AppImage"
97116

98117
windows:
99118
runs-on: windows-2025
100-
119+
101120
steps:
102-
- uses: actions/checkout@v5
103-
104-
- run: choco install fvm
105-
- run: fvm install
106-
- run: fvm flutter pub get
107-
- run: fvm dart run build_runner build --delete-conflicting-outputs
108-
109-
- run: fvm flutter config --enable-windows-desktop
110-
- run: fvm flutter build windows --release
111-
112-
- name: Upload Windows artifact
113-
uses: actions/upload-artifact@v4
114-
with:
121+
- uses: actions/checkout@v5
122+
123+
- run: choco install fvm
124+
- run: fvm install
125+
- run: fvm flutter pub get
126+
- run: fvm dart run build_runner build --delete-conflicting-outputs
127+
128+
- run: fvm flutter config --enable-windows-desktop
129+
- run: fvm flutter build windows --release
130+
131+
- name: Upload Windows artifact
132+
uses: actions/upload-artifact@v4
133+
with:
115134
name: ${{ env.APP_NAME }}-windows-x64
116135
path: build\windows\x64\runner\Release

appimage_builder_x64.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
2+
version: 1
3+
script:
4+
- rm -rf AppDir || true
5+
- mkdir -p AppDir
6+
- cp -r build/linux/x64/release/bundle/* AppDir/
7+
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps/
8+
- mkdir -p AppDir/usr/share/applications/
9+
- cp assets/logo.png AppDir/usr/share/icons/hicolor/256x256/apps/subterfuge.png
10+
11+
AppDir:
12+
path: ./AppDir
13+
app_info:
14+
id: com.ethicnology.subterfuge
15+
name: Subterfuge
16+
icon: subterfuge
17+
version: 1.2.0
18+
exec: subterfuge
19+
exec_args: $@
20+
apt:
21+
arch: amd64
22+
allow_unauthenticated: true
23+
sources:
24+
- sourceline: deb http://archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
25+
- sourceline: deb http://archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse
26+
- sourceline: deb http://archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse
27+
- sourceline: deb http://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse
28+
include:
29+
- libgtk-3-0
30+
exclude:
31+
- humanity-icon-theme
32+
- hicolor-icon-theme
33+
- adwaita-icon-theme
34+
- ubuntu-mono
35+
runtime:
36+
env:
37+
APPDIR_LIBRARY_PATH: $APPDIR/lib
38+
files:
39+
exclude:
40+
- usr/share/man
41+
- usr/share/doc/*/README.*
42+
- usr/share/doc/*/changelog.*
43+
- usr/share/doc/*/NEWS.*
44+
- usr/share/doc/*/TODO.*
45+
test:
46+
fedora:
47+
image: appimagecrafters/tests-env:fedora-30
48+
command: ./AppRun
49+
use_host_x: true
50+
debian:
51+
image: appimagecrafters/tests-env:debian-stable
52+
command: ./AppRun
53+
use_host_x: true
54+
arch:
55+
image: appimagecrafters/tests-env:archlinux-latest
56+
command: ./AppRun
57+
use_host_x: true
58+
centos:
59+
image: appimagecrafters/tests-env:centos-7
60+
command: ./AppRun
61+
use_host_x: true
62+
ubuntu:
63+
image: appimagecrafters/tests-env:ubuntu-xenial
64+
command: ./AppRun
65+
use_host_x: true
66+
67+
AppImage:
68+
arch: x86_64
69+
update-information: guess
70+
sign-key: None

linux/runner/my_application.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ static void my_application_activate(GApplication* application) {
5454

5555
gtk_window_set_default_size(window, 1280, 720);
5656

57+
// Source - https://stackoverflow.com/a
58+
// Posted by Ali Yar Khan
59+
// Retrieved 2026-01-10, License - CC BY-SA 4.0
60+
if (g_file_test("assets", G_FILE_TEST_IS_DIR)){
61+
gtk_window_set_icon_from_file(window, "assets/logo.png", NULL); // For debug mode
62+
} else {
63+
gtk_window_set_icon_from_file(window, "data/flutter_assets/assets/logo.png", NULL); // For release mode
64+
}
65+
66+
5767
g_autoptr(FlDartProject) project = fl_dart_project_new();
5868
fl_dart_project_set_dart_entrypoint_arguments(
5969
project, self->dart_entrypoint_arguments);

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ flutter:
4444
# the material Icons class.
4545
uses-material-design: true
4646
assets:
47-
- assets/logo.png
47+
- assets/logo.png
4848

49-
flutter_icons:
49+
flutter_launcher_icons:
5050
android: "launcher_icon"
5151
ios: true
5252
image_path: "assets/logo.png"

0 commit comments

Comments
 (0)