Skip to content

fix flatpak build

fix flatpak build #60

Workflow file for this run

name: PR Check
on:
pull_request:
branches:
- main
- dev
jobs:
build-mac-ios-android:
runs-on: macos-latest
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: "21"
cache: "gradle"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version-file: simple_live_app/pubspec.yaml
cache: true
- name: Enable Flutter Desktop
run: flutter config --enable-macos-desktop
- name: Restore packages
run: |
cd simple_live_app
flutter pub get
- name: Install appdmg
run: npm install -g appdmg
- name: Install fast-forge
run: |
git clone https://github.com/SlotSun/fastforge.git
cd fastforge
dart pub global activate melos
melos run activate
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build APK
run: |
cd simple_live_app
flutter build apk
- name: Build IPA
run: |
cd simple_live_app
flutter build ios --no-codesign
- name: Build MacOS
run: |
cd simple_live_app
fastforge package --platform macos --targets dmg,zip --skip-clean
build-linux:
strategy:
matrix:
include:
- runner: ubuntu-24.04
arch: x86_64
- runner: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version-file: simple_live_app/pubspec.yaml
channel: master
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv libasound2-dev
- name: Enable Flutter Desktop
run: flutter config --enable-linux-desktop
- name: Restore Packages
run: |
cd simple_live_app
flutter pub get
- name: Install fast-forge
run: |
git clone https://github.com/SlotSun/fastforge.git
cd fastforge
dart pub global activate melos
melos run activate
- name: Build Linux
run: |
cd simple_live_app
fastforge package --platform linux --targets deb,zip --skip-clean
cd build/dist/*
mv simple_live_app-*-linux.deb simplelive-${{ matrix.arch }}-linux.deb
mv simple_live_app-*-linux.zip simplelive-${{ matrix.arch }}-linux.zip
build-windows:
runs-on: windows-latest
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version-file: simple_live_app/pubspec.yaml
cache: true
- name: Enable Flutter Desktop
run: flutter config --enable-windows-desktop
- name: Restore Packages
run: |
cd simple_live_app
flutter clean
flutter pub get
- name: Install fast-forge
run: |
git clone https://github.com/SlotSun/fastforge.git
cd fastforge
dart pub global activate melos
melos run activate
- name: Build Windows
run: |
cd simple_live_app
fastforge package --platform windows --targets msix,zip --skip-clean
# 打包 Flatpak
build-flatpak:
strategy:
matrix:
include:
- runner: ubuntu-24.04
arch: x86_64
- runner: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.runner }}
permissions:
contents: write
steps:
# 签出代码
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# 安装依赖
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:flatpak/stable
sudo apt-get update -q
sudo apt-get install -y flatpak flatpak-builder ca-certificates gnupg software-properties-common
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
git config --global protocol.file.allow always
# 构建 Flatpak bundle
- name: Build flatpak
run: |
flatpak-builder build-dir flatpak/flatpak-manifest.yaml \
--arch=${{ matrix.arch }} \
--repo=${{ matrix.arch }} \
--force-clean \
--user \
--install-deps-from=flathub \
--ccache \
--disable-rofiles-fuse