feature: AppImage release build (#245)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-02-28 13:04:12 +01:00 committed by GitHub
parent 7fbad0b0ce
commit cfcedbcc42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 98 additions and 13 deletions

View file

@ -126,8 +126,8 @@ jobs:
channel: "stable" channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}} flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies - name: Get dependencies
run: flutter pub get run: flutter pub get
@ -169,8 +169,8 @@ jobs:
channel: "stable" channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}} flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # 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:" # optional, change this to specify the cache path cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies - name: Get dependencies
run: flutter pub get run: flutter pub get
@ -205,8 +205,8 @@ jobs:
channel: "stable" channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}} flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies - name: Get dependencies
run: flutter pub get run: flutter pub get
@ -224,7 +224,7 @@ jobs:
path: build/macos/Build/Products/Release-production/macOS.dmg path: build/macos/Build/Products/Release-production/macOS.dmg
build-linux: 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] needs: [fetch-info]
steps: steps:
@ -237,8 +237,12 @@ jobs:
channel: "stable" channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}} flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path 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 - name: Get dependencies
run: flutter pub get run: flutter pub get
@ -246,7 +250,7 @@ jobs:
- name: Get packages - name: Get packages
run: | run: |
sudo apt-get update -y 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 - name: Build Linux app
run: flutter build linux --release --build-number=${{ github.run_number }} run: flutter build linux --release --build-number=${{ github.run_number }}
@ -265,6 +269,21 @@ jobs:
name: fladder-linux name: fladder-linux
path: build/linux/x64/release/bundle 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: build-linux-flatpak:
name: "Flatpak" name: "Flatpak"
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -310,8 +329,8 @@ jobs:
channel: "stable" channel: "stable"
flutter-version: ${{needs.fetch-info.outputs.flutter-version}} flutter-version: ${{needs.fetch-info.outputs.flutter-version}}
cache: true cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
- name: Get dependencies - name: Get dependencies
run: flutter pub get run: flutter pub get
@ -419,6 +438,20 @@ jobs:
- name: Move Linux Flatpak - name: Move Linux Flatpak
run: mv fladder-linux-flatpak/Fladder-Linux.flatpak Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.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 - name: Download Artifacts Web
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@ -445,6 +478,8 @@ jobs:
Fladder-Web-${{needs.fetch-info.outputs.version_name}}.zip 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}}.zip
Fladder-Linux-${{needs.fetch-info.outputs.version_name}}.flatpak 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: release_web:
name: Release Web name: Release Web
@ -485,5 +520,5 @@ jobs:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4 uses: peaceiris/actions-gh-pages@v4
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web publish_dir: ./build/web

7
.gitignore vendored
View file

@ -46,6 +46,13 @@ app.*.map.json
# FVM Version Cache # FVM Version Cache
.fvm/ .fvm/
# AppImage
/AppDir/
/AppDirassets/
/AppDiricons/
/appimage-build/
*.AppImage
*.AppImage.zsync
# flatpak # flatpak
.flatpak-builder .flatpak-builder

12
.vscode/tasks.json vendored
View file

@ -102,6 +102,18 @@
// "runOptions": { // "runOptions": {
// "runOn": "folderOpen" // "runOn": "folderOpen"
// } // }
},
{
"label": "Build AppImage",
"type": "shell",
"command": "/usr/local/bin/appimage-builder",
"args": [
"--recipe",
"AppImageBuilder.yml"
],
"group": {
"kind": "build",
}
} }
], ],
} }

31
AppImageBuilder.yml Normal file
View file

@ -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