Skip to content

Commit

Permalink
feature: AppImage release build (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
  • Loading branch information
PartyDonut and PartyDonut authored Feb 28, 2025
1 parent 7fbad0b commit cfcedbc
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 13 deletions.
61 changes: 48 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ jobs:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"

- name: Get dependencies
run: flutter pub get
Expand Down Expand Up @@ -169,8 +169,8 @@ jobs:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to specify the cache path
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"

- name: Get dependencies
run: flutter pub get
Expand Down Expand Up @@ -205,8 +205,8 @@ jobs:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"

- name: Get dependencies
run: flutter pub get
Expand All @@ -224,7 +224,7 @@ jobs:
path: build/macos/Build/Products/Release-production/macOS.dmg

build-linux:
runs-on: ubuntu-24.04 # bumped from 22.04 (latest) as it would otherwise use libmpv1
runs-on: ubuntu-latest
needs: [fetch-info]

steps:
Expand All @@ -237,16 +237,20 @@ jobs:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
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
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 }}
Expand All @@ -265,6 +269,21 @@ jobs:
name: fladder-linux
path: build/linux/x64/release/bundle

- name: Build AppImage
run: |
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:
name: "Flatpak"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -310,8 +329,8 @@ jobs:
channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"

- name: Get dependencies
run: flutter pub get
Expand Down Expand Up @@ -419,6 +438,20 @@ jobs:
- name: Move Linux Flatpak
run: mv fladder-linux-flatpak/Fladder-Linux.flatpak Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.flatpak

- name: Download Artifacts Linux AppImage
uses: actions/download-artifact@v4
with:
name: fladder-linux-appimage
path: fladder-linux-appimage

- name: Archive Linux artifact
uses: actions/upload-artifact@v4
with:
name: fladder-linux-appimage
path: |
mv fladder-linux-appimage/Fladder_x86_64.AppImage Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.AppImage
mv fladder-linux-appimage/Fladder_x86_64.AppImage.zsync Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.AppImage.zsync
- name: Download Artifacts Web
uses: actions/download-artifact@v4
with:
Expand All @@ -445,6 +478,8 @@ jobs:
Fladder-Web-${{needs.fetch-info.outputs.version_name}}.zip
Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.zip
Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.flatpak
Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.AppImage
Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.AppImage.zsync
release_web:
name: Release Web
Expand Down Expand Up @@ -485,5 +520,5 @@ jobs:
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ app.*.map.json
# FVM Version Cache
.fvm/

# AppImage
/AppDir/
/AppDirassets/
/AppDiricons/
/appimage-build/
*.AppImage
*.AppImage.zsync

# flatpak
.flatpak-builder
Expand Down
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@
// "runOptions": {
// "runOn": "folderOpen"
// }
},
{
"label": "Build AppImage",
"type": "shell",
"command": "/usr/local/bin/appimage-builder",
"args": [
"--recipe",
"AppImageBuilder.yml"
],
"group": {
"kind": "build",
}
}
],
}
31 changes: 31 additions & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
# appimage-builder --recipe 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

# # install (optional)
# sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
version: 1
script:
- rm -rf AppDir || true
- cp -r build/linux/x64/release/bundle AppDir
- mkdir -p AppDir/usr/share/icons/
- cp icons/production/fladder_icon_desktop.png AppDir/usr/share/icons/
AppDir:
path: ./AppDir
app_info:
id: nl.jknaapen.fladder
name: Fladder
icon: fladder_icon_desktop
version: latest
exec: Fladder
exec_args: $@
files:
include:
- assets/fonts/rubik/Rubik-Italic-VariableFont_wght.ttf
- assets/fonts/rubik/Rubik-VariableFont_wght.ttf
- icons/production/fladder_icon_desktop.png
AppImage:
arch: x86_64
update-information: gh-releases-zsync|DonutWare|Fladder|latest|Fladder-Linux-*.AppImage.zsync
file_name: Fladder_x86_64.AppImage

0 comments on commit cfcedbc

Please sign in to comment.