Skip to content

init commit

init commit #1

Workflow file for this run

name: Build Example App
on: [push, pull_request]
jobs:
build:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
strategy:
fail-fast: false
matrix:
target: [apk, linux, windows, macos]
variant: [debug, release]
include:
- target: apk
os: ubuntu-latest
pre-build-script: ""
debug-artifact-path: build/app/outputs/flutter-apk/app-debug.apk
release-artifact-path: build/app/outputs/flutter-apk/app-release.apk
- target: linux
os: ubuntu-latest
pre-build-script: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
debug-artifact-path: build/linux/x64/debug/bundle
release-artifact-path: build/linux/x64/release/bundle
- target: windows
os: windows-latest
pre-build-script: ""
debug-artifact-path: build/windows/x64/runner/Debug
release-artifact-path: build/windows/x64/runner/Release
- target: macos
os: macos-latest
pre-build-script: ""
debug-artifact-path: build/macos/Build/Products/Debug/*.app
release-artifact-path: build/macos/Build/Products/Release/*.app
# - target: ios
# os: macos-latest
# pre-build-script: ""
# artifact-path: |
# build/ios/iphoneos/Runner.app
runs-on: ${{ matrix.os }}
name: ${{ matrix.target }}-${{ matrix.variant }}
steps:
# setup environment
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
if: ${{ matrix.target == 'apk' }}
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: pre-build-script script for ${{ matrix.target }}
run: ${{ matrix.pre-build-script }}
# basic format & linting check
- run: dart pub get
# - run: dart format --output=none --set-exit-if-changed .
- run: dart analyze
# build flutter app
- run: flutter pub get
working-directory: example/
- name: Run flutter ${{ matrix.variant }} build on ${{ matrix.target }}
run: flutter build ${{ matrix.target }} --${{ matrix.variant }} --verbose
working-directory: example/
# upload build artifacts
- uses: actions/upload-artifact@v4
with:
name: example-${{ matrix.target }}-${{ matrix.variant }}
path: |
example/${{ matrix.debug-artifact-path }}
example/${{ matrix.release-artifact-path }}