Skip to content

second commit

second commit #2

name: Build Multi Platform
on:
workflow_dispatch:
push:
branches: ["master"]
jobs:
build-desktop:
name: Build ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux
os: ubuntu-latest
build_command: flutter build linux --release
artifact_path: build/linux/x64/release/bundle
artifact_name: ailurus-linux
- name: windows
os: windows-latest
build_command: flutter build windows --release
artifact_path: build/windows/x64/runner/Release
artifact_name: ailurus-windows
- name: macos
os: macos-latest
build_command: flutter build macos --release
artifact_path: build/macos/Build/Products/Release
artifact_name: ailurus-macos
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev
- name: Enable desktop targets
run: |
flutter config --enable-linux-desktop
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
- name: Get dependencies
run: flutter pub get
- name: Build desktop app
run: ${{ matrix.platform.build_command }}
- name: Upload desktop artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.artifact_name }}
path: ${{ matrix.platform.artifact_path }}
if-no-files-found: error
build-android:
name: Build android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Get dependencies
run: flutter pub get
- name: Build Android APK
run: flutter build apk --release
- name: Build Android App Bundle
run: flutter build appbundle --release
- name: Upload Android artifact
uses: actions/upload-artifact@v4
with:
name: ailurus-android
path: |
build/app/outputs/flutter-apk/*.apk
build/app/outputs/bundle/release/*.aab
if-no-files-found: error