Settings Page #11
Workflow file for this run
This file contains hidden or 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: 🛠 Android CI / Build & Release APK | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - 'v*.*.*' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| permissions: | |
| contents: write | |
| actions: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_and_release: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # Checkout | |
| - name: 📂 Checkout code | |
| uses: actions/checkout@v4 | |
| # Cache pub deps | |
| - name: 🚀 Cache pub deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} | |
| restore-keys: ${{ runner.os }}-pub- | |
| # Java 21 | |
| - name: ☕ Setup Java (Temurin 21) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| # Flutter | |
| - name: 🦋 Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| # Flutter pub get | |
| - name: 📥 Get dependencies | |
| run: flutter pub get | |
| # Setup sherpa models + keyword assets | |
| - name: 🔧 Setup speech model assets | |
| run: bash scripts/setup_assets.sh | |
| # Build APKs | |
| - name: 🏗 Build APKs | |
| run: flutter build apk --release --split-per-abi | |
| # Prepare artifacts for upload/release | |
| - name: 📦 Prepare artifacts | |
| run: | | |
| mkdir -p artifacts | |
| cp build/app/outputs/flutter-apk/*.apk artifacts/ | |
| # ─────────────── ONLY ON TAGS ─────────────── | |
| - name: 🏷️ Create or update Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| artifacts: artifacts/*.apk | |
| token: ${{ secrets.GITHUB_TOKEN }} |