name: Upload Android Release to Play Store
on:
push:
branches:
- main
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Upload to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.example.MyApp
releaseFiles: app/build/outputs/bundle/release/app-release.aab
track: production
status: inProgress
inAppUpdatePriority: 2
userFraction: 0.33
whatsNewDirectory: distribution/whatsnew
mappingFile: app/build/outputs/mapping/release/mapping.txt
debugSymbols: app/intermediates/merged_native_libs/release/out/lib
Upload Android Release to Play Store
GitHub Action to upload Android .apk or .aab files to Google Play Console.
This GitHub Action simplifies uploading Android release files (.apk or .aab) to Google Play Console using the Google Play Developer API v3. You can automate the release process, assign tracks, and manage app versions with ease.
How to Upload Android Release Files
To upload Android release files (.apk or .aab), use the releaseFiles
input. You can provide one or more file paths, separated by commas.
with:
releaseFiles: app/build/outputs/bundle/release/app-release.aab
How to Provide Service Account Credentials
For authentication, provide the service account JSON credentials in plain text. You can store the credentials as a GitHub secret and reference it in the workflow.
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
How to Set the Package Name
Specify the package name (Application ID) of the app you're uploading. Ensure that this package is already registered in the Play Console.
with:
packageName: com.example.MyApp
How to Select a Track for Uploading
The track
input defines where the uploaded app will be distributed (e.g., production, beta). You can refer to the APKs and Tracks documentation for valid track names.
with:
track: production
How to Assign a Release Name
You can provide a user-friendly release name using the releaseName
input. If not specified, the Google Play Console will auto-generate one.
with:
releaseName: v1.0.0
How to Set In-App Update Priority
The inAppUpdatePriority
input defines the priority level for in-app updates, where 0 is the lowest and 5 is the highest priority.
with:
inAppUpdatePriority: 3
How to Specify a User Fraction for Staged Rollout
To control how many users receive the staged version of the app, use the userFraction
input. The value should be between 0.0 and 1.0, where 1.0 means 100% of users.
with:
userFraction: 0.33
How to Define Release Status
The status
input sets the release status, such as completed
, inProgress
, halted
, or draft
. The default value is completed
.
with:
status: inProgress
How to Upload Localized "What's New" Files
To upload release notes in multiple languages, use the whatsNewDirectory
input. Each file should follow the pattern whatsnew-<LOCALE>
.
with:
whatsNewDirectory: distribution/whatsnew
Example directory structure:
distribution/
└─ whatsnew/
├─ whatsnew-en-US
├─ whatsnew-de-DE
└─ whatsnew-ja-JP
How to Upload Mapping Files for Crash Reports
The mappingFile
input allows you to upload the mapping.txt
file, which is used to de-obfuscate stack traces in crash reports.
with:
mappingFile: app/build/outputs/mapping/release/mapping.txt
How to Upload Debug Symbols
Use the debugSymbols
input to upload the native-debug-symbols.zip file or a folder containing your debug symbols.
with:
debugSymbols: app/intermediates/merged_native_libs/release/out/lib
How to Control Review of Changes
The changesNotSentForReview
input indicates whether the changes in this edit will be reviewed immediately or not. By default, it is set to false
, meaning the changes are sent for review automatically.
with:
changesNotSentForReview: false
How to Use Service Account JSON File
Instead of providing the service account credentials in plain text, you can provide a path to the JSON file using the serviceAccountJson
input.
with:
serviceAccountJson: ${{ secrets.SERVICE_ACCOUNT_JSON_FILE }}
How to Append Information to an Existing Edit
The existingEditId
input allows you to append information to an existing edit instead of creating a new one. This is useful when continuing an unfinished edit.
with:
existingEditId: ${{ steps.previous-edit.outputs.editId }}
Monitoring GitHub Actions Workflows
CICube is a GitHub Actions monitoring tool that provides you with detailed insights into your workflows to further optimize your CI/CD pipeline. With CICube, you will be able to track your workflow runs, understand where the bottlenecks are, and tease out the best from your build times. Go to cicube.io now and create a free account to better optimize your GitHub Actions workflows!