This GitHub Action automates the process of publishing Android applications to the Google Play Store Beta or Internal testing track. It handles building App Bundles (AAB), signing, and deployment through Fastlane.
- Automated Play Store deployment
- Support for Internal and Beta testing tracks
- AAB (Android App Bundle) generation
- Release signing
- Artifact archiving
- Google Play Console integration
Before using this action, ensure you have:
- A Google Play Console account with an existing app
- A service account with appropriate permissions in Google Play Console
- A release keystore for signing your app
- Google Services JSON file for your project
Create a Gemfile
in your project root:
source "https://rubygems.org"
gem "fastlane"
Create a fastlane/Fastfile
with the following content:
default_platform(:android)
platform :android do
desc "Bundle Play Store Release"
lane :bundlePlayStoreRelease do |options|
gradle(
task: "bundle",
build_type: "Release",
properties: {
"android.injected.signing.store.file" => options[:storeFile],
"android.injected.signing.store.password" => options[:storePassword],
"android.injected.signing.key.alias" => options[:keyAlias],
"android.injected.signing.key.password" => options[:keyPassword],
}
)
end
desc "Deploy to Internal Testing Track"
lane :deploy_internal do
upload_to_play_store(
track: 'internal',
aab: lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH],
json_key: 'secrets/playStorePublishServiceCredentialsFile.json',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
skip_upload_changelogs: true
)
end
desc "Promote Internal to Beta"
lane :promote_to_beta do
upload_to_play_store(
track: 'internal',
track_promote_to: 'beta',
json_key: 'secrets/playStorePublishServiceCredentialsFile.json',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
skip_upload_changelogs: true
)
end
end
Add the following workflow to your GitHub Actions:
name: Publish to Play Store
on:
release:
types: [published]
jobs:
publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Publish to Play Store
uses: openMF/[email protected]
with:
android_package_name: 'app'
release_type: 'beta' # or 'internal'
google_services: ${{ secrets.GOOGLE_SERVICES }}
playstore_creds: ${{ secrets.PLAYSTORE_CREDS }}
keystore_file: ${{ secrets.RELEASE_KEYSTORE }}
keystore_password: ${{ secrets.KEYSTORE_PASSWORD }}
keystore_alias: ${{ secrets.KEYSTORE_ALIAS }}
keystore_alias_password: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
Input | Description | Required |
---|---|---|
release_type |
Type of release ('internal' or 'beta') | Yes |
android_package_name |
Name of your Android project module | Yes |
keystore_file |
Base64 encoded release keystore file | Yes |
keystore_password |
Password for the keystore file | Yes |
keystore_alias |
Alias for the keystore file | Yes |
keystore_alias_password |
Password for the keystore alias | Yes |
google_services |
Base64 encoded Google services JSON file | Yes |
playstore_creds |
Base64 encoded Play Store service account JSON file | Yes |
- Encode your files to base64:
base64 -i path/to/release.keystore -o keystore.txt
base64 -i path/to/google-services.json -o google-services.txt
base64 -i path/to/play-store-credentials.json -o playstore-creds.txt
- Add the following secrets to your GitHub repository:
RELEASE_KEYSTORE
: Content of keystore.txtKEYSTORE_PASSWORD
: Your keystore passwordKEYSTORE_ALIAS
: Your keystore aliasKEYSTORE_ALIAS_PASSWORD
: Your keystore alias passwordGOOGLE_SERVICES
: Content of google-services.txtPLAYSTORE_CREDS
: Content of playstore-creds.txt
- The action will:
- Build a signed Android App Bundle (AAB)
- Upload the AAB as a GitHub artifact
- Deploy to Play Store Internal testing track
- Optionally promote to Beta if
release_type
is set to 'beta'
The action saves the generated AAB files as artifacts with the name 'release-aabs'. You can find these in your GitHub Actions run.