Updated version in pubspec #12
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 Build & Deploy | |
| on: | |
| push: | |
| tags: ['*'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build AAB and APK | |
| 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: Install Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.35.4' | |
| - name: Prepare CI keystore from GitHub Secrets | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | |
| run: | | |
| if [ -z "$KEYSTORE_BASE64" ]; then | |
| echo "::error::KEYSTORE_BASE64 secret is not set. Please add your base64-encoded keystore as a GitHub secret." | |
| exit 1 | |
| fi | |
| echo "Decoding GitHub secret keystore to ci_keystore.jks" | |
| echo "$KEYSTORE_BASE64" | base64 --decode > ci_keystore.jks | |
| echo "Exporting signing env vars" | |
| if [ -z "$KEY_ALIAS" ]; then echo "::error::KEY_ALIAS secret is not set."; exit 1; fi | |
| if [ -z "$KEY_PASSWORD" ]; then echo "::error::KEY_PASSWORD secret is not set."; exit 1; fi | |
| if [ -z "$STORE_PASSWORD" ]; then echo "::error::STORE_PASSWORD secret is not set."; exit 1; fi | |
| echo "KEY_ALIAS=$KEY_ALIAS" >> $GITHUB_ENV | |
| echo "KEY_PASSWORD=$KEY_PASSWORD" >> $GITHUB_ENV | |
| echo "STORE_PASSWORD=$STORE_PASSWORD" >> $GITHUB_ENV | |
| - name: Cache pub | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| move/.dart_tool | |
| key: ${{ runner.os }}-pub-${{ hashFiles('move/pubspec.yaml') }} | |
| - name: Install dependencies | |
| run: | | |
| cd move | |
| flutter pub get | |
| flutter pub upgrade | |
| - name: Run analyzer | |
| run: | | |
| cd move | |
| flutter analyze || true | |
| - name: Build AAB (release) | |
| run: | | |
| cd move | |
| flutter build appbundle --release --no-shrink | |
| - name: Build APK (release) | |
| run: | | |
| cd move | |
| flutter build apk --release --no-shrink | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-builds | |
| path: | | |
| move/build/app/outputs/bundle/release/*.aab | |
| move/build/app/outputs/flutter-apk/app-release.apk | |
| publish: | |
| name: Publish to Google Play (Internal) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: android-builds | |
| - name: Publish to Google Play | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | |
| packageName: 'com.protocentral.healthypi_move' | |
| releaseFiles: | | |
| move/build/app/outputs/bundle/release/*.aab | |
| track: internal |