-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build Flutter Linux App as AppImage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Install Flutter SDK | ||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: 'stable' | ||
|
||
# Install AppImage dependencies | ||
- name: Install AppImage and Linux dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev libblkid-dev e2fslibs-dev liblzma-dev | ||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | ||
chmod +x linuxdeploy-x86_64.AppImage appimagetool-x86_64.AppImage | ||
# Run Flutter build for Linux | ||
- name: Build Flutter Linux App | ||
run: flutter build linux | ||
|
||
# Package the built Linux app into an AppImage | ||
- name: Create AppImage | ||
run: | | ||
APP_DIR=build/linux/x64/release/bundle | ||
./linuxdeploy-x86_64.AppImage \ | ||
--appdir=$APP_DIR \ | ||
--output appimage \ | ||
--desktop-file $APP_DIR/myapp.desktop \ | ||
--icon-file $APP_DIR/myapp.png | ||
# Upload the AppImage as an artifact (optional) | ||
- name: Upload AppImage artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: my-flutter-app.AppImage | ||
path: '*.AppImage' | ||
|