Send to the Play Store
In the previous tutorial, the final step was uploading the Android App Bundle as a GitHub Actions artifact. You can extend that workflow to publish the signed .aab directly to the Play Store.
This guide follows the same flow as the Ionic tutorial for sending an Android build to the Play Store.
You will need to upload your .aab file to the Play Store manually at least once before automating the process.
Open .github/workflows/app-android.yml and add the following step:
- name: Upload to Play Store uses: r0adkll/upload-google-play@v1 with: serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} packageName: [your-bundle-id] releaseFiles: android/app/build/outputs/bundle/release/app-release-signed.aab track: production status: completed whatsNewDirectory: distribution/whatsnew debugSymbols: app/intermediates/merged_native_libs/release/out/libReplace [your-bundle-id] with the package name of your application, for example com.example.MyApp.
This workflow requires a SERVICE_ACCOUNT_JSON secret in your GitHub repository.
Configure Service Account
Section titled “Configure Service Account”- Enable the Google Play Android Developer API.
- Go to Google Play Android Developer API and click
Enable. - Create a new service account in Google Cloud Platform.
- Open Google Cloud Console.
- Go to
IAM & Admin>Service accounts>Create service account. - Pick a name for the new account and do not grant it any permissions.
To use the account from GitHub Actions, the simpler option is to store the account key in GitHub secrets:
- Open the newly created service account.
- Open the
Keystab and add a new key using theJSONtype. - Save the downloaded JSON file.
- Store the contents of that file in a GitHub secret named
SERVICE_ACCOUNT_JSON. - Use
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}in the workflow step.
An alternative is workload identity authentication, which is more secure and recommended by Google Cloud. That approach uses google-github-actions/auth@v2 to create short-lived credentials and then passes serviceAccountJson: ${{ steps.auth.outputs.credentials_file_path }} to the Play Store upload action.
After creating the service account, add it to Google Play Console:
- Open Google Play Console and choose your developer account.
- Open
Users and permissions. - Click
Invite new userand add the email address of the service account. - Grant access to the app you want the service account to deploy in
App permissions.
Creating your “What’s New”
Section titled “Creating your “What’s New””The whatsNewDirectory option points to localized changelog files. A typical structure looks like this:
distribution/└─ whatsnew/ ├─ whatsnew-en-US ├─ whatsnew-de-DE └─ whatsnew-ja-JPEach file should contain the release notes for that locale.
Summary
Section titled “Summary”Running these steps will allow you to send your Android app to the Play Store as part of your automated build process.
Review the selected track, release status, and service account permissions before using the workflow in production.
This workflow builds on the Android deployment process described in Deploy Android.