Skip to content

Commit 9814360

Browse files
authored
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.
1 parent e58078f commit 9814360

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/smoke.yml

+38
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,44 @@ jobs:
4242
- name: Build Android debug
4343
run: flutter build appbundle --debug
4444

45+
- name: Setup bundletool
46+
if: github.ref == 'refs/heads/main'
47+
uses: amyu/setup-bundletool@f7a6fdd8e04bb23d2fdf3c2f60c9257a6298a40a
48+
- name: Install the google play key material
49+
if: github.ref == 'refs/heads/main'
50+
env:
51+
GOOGLE_PLAY_API_JWT_BASE64: ${{ secrets.GOOGLE_PLAY_API_JWT_BASE64 }}
52+
GOOGLE_PLAY_KEYSTORE_BASE64: ${{ secrets.GOOGLE_PLAY_KEYSTORE_BASE64 }}
53+
run: |
54+
GOOGLE_PLAY_API_JWT_PATH="$RUNNER_TEMP/gp_api.json"
55+
echo "GOOGLE_PLAY_API_JWT_PATH=$GOOGLE_PLAY_API_JWT_PATH" >> $GITHUB_ENV
56+
echo -n "$GOOGLE_PLAY_API_JWT_BASE64" | base64 --decode --output "$GOOGLE_PLAY_API_JWT_PATH"
57+
58+
GOOGLE_PLAY_KEYSTORE_PATH="$RUNNER_TEMP/gp_signing.jks"
59+
echo "GOOGLE_PLAY_KEYSTORE_PATH=$GOOGLE_PLAY_KEYSTORE_PATH" >> $GITHUB_ENV
60+
echo -n "$GOOGLE_PLAY_KEYSTORE_BASE64" | base64 --decode --output "$GOOGLE_PLAY_KEYSTORE_PATH"
61+
- name: Generate debug apk
62+
if: github.ref == 'refs/heads/main'
63+
env:
64+
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
65+
GOOGLE_PLAY_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_PLAY_KEYSTORE_PASSWORD }}
66+
run: |
67+
bundletool build-apks \
68+
--bundle=build/app/outputs/bundle/debug/app-debug.aab \
69+
--output=build/app/outputs/apk/debug/app-debug.apks \
70+
--mode=universal \
71+
--ks=$GOOGLE_PLAY_KEYSTORE_PATH \
72+
--ks-key-alias=key \
73+
--ks-pass=pass:$GOOGLE_PLAY_KEYSTORE_PASSWORD
74+
unzip -p build/app/outputs/apk/debug/app-debug.apks universal.apk > build/app/outputs/apk/debug/app-debug.apk
75+
- name: Collect debug apk
76+
if: github.ref == 'refs/heads/main'
77+
uses: actions/upload-artifact@v3
78+
with:
79+
name: app-debug.apk
80+
path: build/app/outputs/apk/debug/app-debug.apk
81+
retention-days: 60
82+
4583
build-ios:
4684
name: iOS
4785
runs-on: macos-latest

0 commit comments

Comments
 (0)