From 98143606139b4348ea33d6a0d5837ed973d1a1c3 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Tue, 22 Oct 2024 14:30:59 -0400 Subject: [PATCH] Upload debug apk (#187) This adds steps to our android debug smoke build to upload a debug apk on merges to main, retained for 60 days. This can be used to help test and troubleshoot builds in between Android releases. --- .github/workflows/smoke.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index b9f8b3a..3b62393 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -42,6 +42,44 @@ jobs: - name: Build Android debug run: flutter build appbundle --debug + - name: Setup bundletool + if: github.ref == 'refs/heads/main' + uses: amyu/setup-bundletool@f7a6fdd8e04bb23d2fdf3c2f60c9257a6298a40a + - name: Install the google play key material + if: github.ref == 'refs/heads/main' + env: + GOOGLE_PLAY_API_JWT_BASE64: ${{ secrets.GOOGLE_PLAY_API_JWT_BASE64 }} + GOOGLE_PLAY_KEYSTORE_BASE64: ${{ secrets.GOOGLE_PLAY_KEYSTORE_BASE64 }} + run: | + GOOGLE_PLAY_API_JWT_PATH="$RUNNER_TEMP/gp_api.json" + echo "GOOGLE_PLAY_API_JWT_PATH=$GOOGLE_PLAY_API_JWT_PATH" >> $GITHUB_ENV + echo -n "$GOOGLE_PLAY_API_JWT_BASE64" | base64 --decode --output "$GOOGLE_PLAY_API_JWT_PATH" + + GOOGLE_PLAY_KEYSTORE_PATH="$RUNNER_TEMP/gp_signing.jks" + echo "GOOGLE_PLAY_KEYSTORE_PATH=$GOOGLE_PLAY_KEYSTORE_PATH" >> $GITHUB_ENV + echo -n "$GOOGLE_PLAY_KEYSTORE_BASE64" | base64 --decode --output "$GOOGLE_PLAY_KEYSTORE_PATH" + - name: Generate debug apk + if: github.ref == 'refs/heads/main' + env: + TOKEN: ${{ secrets.MACHINE_USER_PAT }} + GOOGLE_PLAY_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_PLAY_KEYSTORE_PASSWORD }} + run: | + bundletool build-apks \ + --bundle=build/app/outputs/bundle/debug/app-debug.aab \ + --output=build/app/outputs/apk/debug/app-debug.apks \ + --mode=universal \ + --ks=$GOOGLE_PLAY_KEYSTORE_PATH \ + --ks-key-alias=key \ + --ks-pass=pass:$GOOGLE_PLAY_KEYSTORE_PASSWORD + unzip -p build/app/outputs/apk/debug/app-debug.apks universal.apk > build/app/outputs/apk/debug/app-debug.apk + - name: Collect debug apk + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v3 + with: + name: app-debug.apk + path: build/app/outputs/apk/debug/app-debug.apk + retention-days: 60 + build-ios: name: iOS runs-on: macos-latest