How to Distribute a Build With Firebase App Distribution in CI
Firebase App Distribution ships pre-release builds to named tester groups from CI using a Google service account credential.
Authenticate the Firebase CLI with GOOGLE_APPLICATION_CREDENTIALS pointing at a decoded service account key, then run appdistribution:distribute with the app ID and tester groups.
Steps
- Store the service account JSON as a base64 secret and decode it on the runner.
- Set
GOOGLE_APPLICATION_CREDENTIALSto the decoded file path. - Run
firebase appdistribution:distributewith the app ID and groups.
Terminal
Terminal
echo "$FIREBASE_SA_B64" | base64 -d > "$RUNNER_TEMP/firebase-sa.json"
export GOOGLE_APPLICATION_CREDENTIALS="$RUNNER_TEMP/firebase-sa.json"
firebase appdistribution:distribute app/build/outputs/apk/release/app-release.apk \
--app "1:1234567890:android:abcdef" \
--groups "qa,beta-testers" \
--release-notes "CI build $GITHUB_SHA"Gotchas
- The service account needs the Firebase App Distribution Admin role to publish releases.
- Remove the decoded credential file after distribution completes.
Related guides
How to Distribute an Android App to Google Play in CIUpload an AAB to Google Play in CI with fastlane supply and a service account JSON key, promoting to a chosen…
How to Manage Mobile Signing Secrets Safely in CIManage mobile signing secrets safely in CI by base64-encoding keys into repo or environment secrets, decoding…