Although Bitrise provides Firebase App Distribution step (at the time of writing in beta), we’ll use dedicated Gradle plugin and Gradle Runner step like in verification workflow. Note there are several ways to authenticate the Firebase user. In this case, we’ll use a service account.
we need a json file with the private key. It can be uploaded to Bitrise.io and then injected to builds when needed. There are a few options to do that. One of the easiest is to use the Generic bulgaria mobile number File Storage step which downloads all the files from storage and exports path to a directory containing them as an environment variable which then can be referenced in the Gradle Runner step.
At the end, we deploy staging APK(s) using Deploy to bitrise.io – Apps, Logs, Artifacts step. This additional deployment acts only as a fallback. If something goes wrong with Firebase App distribution e.g. Firebase API responds with HTTP 504 error then APK is still available without necessity to retrigger the build. Finally, we update the Bitrise cache to speed up further builds.
Production version
Deploy production workflow
The structure of this workflow is exactly the same as the previous one. It differs only by deployment destination. Instead of Firebase, we use the Google Play Store here. Note that deploying to the store does not necessarily mean automatic public release. Usually, the app is first deployed to one of the pre-release tracks like alpha or internal test and then promoted to the public production track in an appropriate moment.
Bitrise provides Deploy to Google Play step which can take URL to store credentials file. So there is no need to download it like in the case of Firebase. However, we use the File downloader step to get keystore used to sign the app.
In order to use a service account
-
- Posts: 30
- Joined: Mon Dec 23, 2024 3:41 am