1db5f3dedf
analyze runs on every push/PR (fast check). release-apk only fires on push to master or workflow_dispatch (slow build). Doc-only pushes no longer trigger any CI run. workflow_dispatch triggers both jobs unconditionally.
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'lib/**.dart'
|
|
- 'test/**.dart'
|
|
- 'android/**'
|
|
- 'pubspec.yaml'
|
|
- 'pubspec.lock'
|
|
pull_request:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
# Target the self-hosted Flutter/Android runner at the android-stuff org.
|
|
# See tool/setup_ci_runner.sh for how that runner is provisioned.
|
|
#
|
|
# The runner is host-mode so the same JDK 17 + Android SDK + Flutter
|
|
# toolchain is used as the verified release — nothing installs per-run.
|
|
|
|
jobs:
|
|
analyze:
|
|
name: Analyze & Test
|
|
runs-on: flutter-android
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Toolchain
|
|
run: |
|
|
flutter --version
|
|
echo "ANDROID_HOME=${ANDROID_HOME:?not set on this runner}"
|
|
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Analyze
|
|
run: flutter analyze
|
|
|
|
release-apk:
|
|
name: Release APK
|
|
runs-on: flutter-android
|
|
needs: [analyze]
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Build release APK
|
|
run: flutter build apk --release
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-release-apk
|
|
path: build/app/outputs/flutter-apk/app-release.apk
|
|
if-no-files-found: error
|