@@ -12,17 +12,15 @@ concurrency:
1212 cancel-in-progress : true
1313
1414jobs :
15- # 打包 Android、iOS、Mac
16- build-mac-ios-android :
17- # https://github.com/actions/runner-images/issues/12541
18- runs-on : macos-15
1915
20- permissions :
21- contents : write
16+ # packing android on ubuntu, macos slowly
17+ build-android :
18+ runs-on : ubuntu-latest
19+ permissions : write-all
2220
2321 steps :
2422 # 签出代码
25- - uses : actions/checkout@v4
23+ - uses : actions/checkout@v6
2624 with :
2725 ref : dev
2826
4038 echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> simple_live_app/android/key.properties
4139 echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> simple_live_app/android/key.properties
4240
41+ # 设置 JAVA 环境
42+ - uses : actions/setup-java@v5
43+ with :
44+ distribution : " zulu"
45+ java-version : " 17"
46+ cache : " gradle"
47+ cache-dependency-path : |
48+ simple_live_app/android/*.gradle*
49+ simple_live_app/android/**/gradle-wrapper.properties
50+
51+ # 设置 Flutter
52+ - name : Flutter action
53+ uses : subosito/flutter-action@v2
54+ with :
55+ channel : stable
56+ flutter-version-file : simple_live_app/pubspec.yaml
57+ cache : true
58+
59+ # 更新 Flutter 的 packages
60+ - name : Restore packages
61+ run : |
62+ cd simple_live_app
63+ flutter pub get
64+
65+ # 打包 APK
66+ - name : Build APK
67+ run : |
68+ cd simple_live_app
69+ flutter build apk --release --split-per-abi
70+
71+ # 上传 Artifacts
72+ - name : Upload APK to Artifacts
73+ uses : actions/upload-artifact@v4
74+ with :
75+ name : android
76+ path : |
77+ simple_live_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
78+ simple_live_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
79+ simple_live_app/build/app/outputs/flutter-apk/app-x86_64-release.apk
80+
81+
82+ # 打包iOS、Mac
83+ build-mac-ios :
84+ # https://github.com/actions/runner-images/issues/12541
85+ runs-on : macos-15
86+
87+ permissions :
88+ contents : write
89+
90+ steps :
91+ # 签出代码
92+ - uses : actions/checkout@v4
93+ with :
94+ ref : dev
95+
4396 # 设置 JAVA 环境
4497 - uses : actions/setup-java@v4
4598 with :
@@ -76,22 +129,6 @@ jobs:
76129 dart pub global activate melos
77130 melos run activate
78131
79- # 打包 APK
80- - name : Build APK
81- run : |
82- cd simple_live_app
83- flutter build apk --release --split-per-abi
84-
85- # 上传 Artifacts
86- - name : Upload APK to Artifacts
87- uses : actions/upload-artifact@v4
88- with :
89- name : android
90- path : |
91- simple_live_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
92- simple_live_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
93- simple_live_app/build/app/outputs/flutter-apk/app-x86_64-release.apk
94-
95132 # 打包 iOS
96133 - name : Build IPA
97134 run : |
@@ -160,7 +197,21 @@ jobs:
160197 - name : Update apt-get
161198 run : sudo apt-get update
162199 - name : Install Dependencies
163- run : sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv libasound2-dev
200+ run : |
201+ sudo apt-get update
202+ sudo apt-get install -y clang cmake libgtk-3-dev unzip libasound2-dev gcc g++ autoconf automake \
203+ debhelper glslang-dev ladspa-sdk xutils-dev libasound2-dev libarchive-dev libbluray-dev \
204+ libdav1d-dev libdvdnav-dev libegl1-mesa-dev libepoxy-dev libfontconfig-dev libfreetype6-dev \
205+ libfribidi-dev libgl1-mesa-dev libgbm-dev libgme-dev libgsm1-dev libharfbuzz-dev libjpeg-dev \
206+ libbrotli-dev liblcms2-dev libmodplug-dev libmp3lame-dev libopenal-dev \
207+ libopus-dev libopencore-amrnb-dev libopencore-amrwb-dev libpulse-dev librtmp-dev \
208+ libsdl2-dev libsixel-dev libssh-dev libsoxr-dev libspeex-dev libtool \
209+ libv4l-dev libva-dev libvdpau-dev libvorbis-dev libvo-amrwbenc-dev \
210+ libunwind-dev libvpx-dev libwayland-dev libx11-dev libxext-dev libdrm-dev \
211+ libxkbcommon-dev libxrandr-dev libxss-dev libxv-dev libxvidcore-dev \
212+ linux-libc-dev nasm ninja-build pkg-config python3 python3-docutils wayland-protocols \
213+ x11proto-core-dev zlib1g-dev libfdk-aac-dev libtheora-dev libwebp-dev \
214+ unixodbc-dev libpq-dev libxxhash-dev libaom-dev libbs2b-dev libcaca-dev libcdio-paranoia-dev
164215 # 打开 Linux Desktop 支持
165216 - name : Enable Flutter Desktop
166217 run : flutter config --enable-linux-desktop
@@ -238,6 +289,7 @@ jobs:
238289 run : |
239290 cd simple_live_app
240291 fastforge package --platform windows --targets msix,zip,exe --skip-clean
292+ cd build/dist/*
241293 Get-ChildItem "simple_live_app-*" | ForEach-Object {
242294 $newName = $_.Name -replace '^simple_live_app', 'Slive'
243295 Rename-Item $_ -NewName $newName
@@ -291,7 +343,7 @@ jobs:
291343 --install-deps-from=flathub \
292344 --ccache \
293345 --disable-rofiles-fuse
294- flatpak build-bundle ${{ matrix.arch }} Slive-${{ matrix.arch }}.flatpak io.github.SlotSun.dart_simple_live
346+ flatpak build-bundle ${{ matrix.arch }} Slive-${{ matrix.arch }}.flatpak io.github.SlotSun.Slive
295347
296348 # 上传 Flatpak 包至 Artifacts
297349 - name : Upload linux flatpak to artifacts
0 commit comments