First you have to create a Google Play API Access. To do that go to the Google Play Developer Console and then with the account owner go to Settings -> API access and create a Google Play Android Developer project.
After that follow the instructions to create a Service Account. When you click Create Client ID, choose Service Account. You will get a JSON file with a public key and the service email.
For the initial setup only, you must have access to the Google account which owns the [Google Play publisher account][gp-docs-distribute].
This is required to enable API access from GitHub Actions to your Google Play account.
Note that having admin access is not enough; you need the account owner.
You can see who the account owner is under [Settings → User accounts & rights][gp-console-admin] in the Google Play developer console.
- The app being uploaded must already exist in Google Play; you cannot use the API to upload brand new apps
If you try to upload an AAB file to Google Play (including manually via the Google Play Developer Console), and its size is perhaps 100MB+, it may give you a warning:
The installation of the app bundle may be too large and trigger user warning on some […] this needs to be explicitly acknowledged
This plugin automatically "acknowledges" that warning on Google Play on your behalf when uploading any AAB files, regardless of their size, so you should not see any errors.
If you do see see any unexpected behaviour related to uploading bundles, or warnings appearing for end users, please let us know.
The following initial setup process is demonstrated in this imge
Install this plugin via the marketplace plugin manager. ensure that the prerequisite [Google OAuth Credentials Plugin][plugin-google-oauth], [Token Macro Plugin][plugin-token-macro] and their dependencies are also.
To enable automated access to your Google Play account, you must create a service account:
- Sign in to the [Google Play developer console][gp-console] as the account owner
- Select Settings → Developer account → API access
- Under Service Accounts, click "Create Service Account"
- Follow the link to the Google API Console
- Click the "Create service account" button
- Give the service account any name you like, e.g. "Github Actions"
- Choose Service Accounts > Service Account User ( 中文搜尋要用[服務帳戶使用者]) for the "Role" field
- Enable "Furnish a new private key"
- Choose "JSON" as the key type (P12 works as well, but the Plugin suppter a JSON is a little simpler)
- Click the "Save" button
- Note that a .json file is downloaded, named something like "api-xxxxxxxxx-xxxxx-xxxx.json"
- Close the dialog that appears
- Copy the email address of the new user (something like "Github Actions@api-xxxxxxxxx-xxxxx-xxxx.iam.gserviceaccount.com")
- You can now close the page
- Return to the Google Play developer console page
- Click "Done" on the dialog
- Note that the service account has been associated with the Google Play publisher account
If it hasn't, follow these additional steps before continuing:- Click "Users & permissions" in the menu
- Click "Invite new user"
- Paste in the email address you copied above
- Continue from step 5
- Click the "Grant access" button for the account (e.g. "Github Actions@api-xxxxxxxxx-xxxxx-xxxx.iam.gserviceaccount.com")
- Ensure that at least the following permissions are enabled:
- View app information — this is required for the plugin to function
- Manage production releases — optional, if you want to upload APKs to production
- Manage testing track releases — if you want to upload APKs to alpha, beta, internal, or custom test tracks
- Click "Add user" (or "Send invitation", as appropriate)
- You can now log out of the Google Play publisher account
To do so, visit Google Play Console to set up API access and don’t forget to click Grant Access when you are done.
Refer to
https://github.com/jenkinsci/google-play-android-publisher-plugin/blob/master/README.md https://medium.com/@iqan/continuously-releasing-flutter-app-to-play-store-using-github-actions-eca2f5f6e996
