-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.73 KB
/
build.yaml
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
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: '3.24.3'
# Install AppImage and Linux 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 libmpv-dev mpv ninja-build
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
# Fetch Flutter dependencies
- name: Install Flutter dependencies
run: flutter pub get
# 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'