-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (104 loc) · 3.43 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build Flutter Linux App as AppImage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-appimage:
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 fuse desktop-file-utils
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x ./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
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: linux-bin
path: build/linux/x64/release/bundle
# Ensure executable permissions
- name: Set executable permissions
run: chmod +x build/linux/x64/release/bundle/open_media_server_app
- run: |
mkdir -p assets/AppImage/usr/bin/
cp -r build/linux/x64/release/bundle/** assets/AppImage/usr/bin/
chmod +x assets/AppImage/AppRun
# Package the built Linux app into an AppImage
- name: Create AppImage
run: ARCH=x86_64 ./appimagetool-x86_64.AppImage assets/AppImage HelloWorld.AppImage
# Upload the AppImage as an artifact (optional)
- name: Upload AppImage artifact
uses: actions/upload-artifact@v3
with:
name: my-flutter-app.AppImage
path: '*.AppImage'
build-apk:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
# Install Flutter SDK
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.3'
# Fetch Flutter dependencies
- name: Install Flutter dependencies
run: flutter pub get
# Run Flutter build for Linux
- name: Build Flutter Linux App
run: flutter build apk
- run: ls -R
# Upload the AppImage as an artifact
- name: Upload AppImage artifact
uses: actions/upload-artifact@v3
with:
name: my-flutter-app.apk
path: "./build/app/outputs/apk/release/app-release.apk"
build-web:
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'
# Fetch Flutter dependencies
- name: Install Flutter dependencies
run: flutter pub get
- run: flutter build web
working-directory: ./
shell: bash
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: web
path: ./build/web/