Do only build when pushing to main and on manual build #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Android APK | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-apk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: moonrepo/setup-rust@v1 | |
with: | |
channel: "1.74" | |
components: rustfmt | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" # AdoptOpenJDK is now Eclipse Temurin | |
java-version: "11" | |
- uses: kuhnroyal/flutter-fvm-config-action@v2 | |
id: fvm-config-action | |
- name: Using Flutter ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
- uses: bluefireteam/melos-action@v3 | |
- name: Install Dart dependencies | |
run: dart pub get | |
- name: Generate FFI bindings and build native Android libraries | |
run: melos build | |
- name: Build APK | |
working-directory: ./packages/app | |
run: flutter build apk --flavor qa | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: app-qa-release | |
path: packages/app/build/app/outputs/flutter-apk/app-qa-release.apk |