Leave a rating/review
The action needed to deploy a build to the Play Store is similar to the one you used for app distribution but the setup is a bit more complex. It requires you to use a service account. Don’t worry if you haven’t heard of the term, you’ll create one shortly.
This video assumes that you have a Google Play account listing set up for your app.
Open your web browser and head to https://play.google.com/console. Go to Setup ▸ API access. Once there, click the Create a new Google Cloud project radio button and select Save Project in the bottom right corner of the page.
Once the Google Cloud project has been created, click View in Google Cloud Platform.
On the Google Cloud Console page, click the hamburger menu on the top-left and select APIs & Services ▸ Library.
Search for the Google Play Android Developer API. On the API details page, ensure the that API is enabled. In this case, the API is already enabled.
Next, open the hamburger menu again and select IAM & Admin. Select Service Accounts from the left menu.
Click Learn how to create service account.
On the Service accounts page, click CREATE SERVICE ACCOUNT .
Enter a name for the account and click CREATE AND CONTINUE.
Provide the account with the Editor and click CONTNUE.
Finally, click DONE to return to the Service Accounts page.
Click the three-dot menu next to the service account you just created.
Select Manage Keys to open the KEYS tab.
Click ADD KEY and select Create new key.
Select JSON and click CREATE.
This step will generate the key and then download it to your computer.
Go back to the Play Console tab on your browser and click Refresh on the pop-up.
The Service accounts section will refresh and the account you just created will appear.
You need to grant access to the service account to manage releases.
Click Manage Google Play permissions. This will open the Account permissions tab.
In the Releases section, select Release to production, exclude devices, and use Play App Signing and Release apps to testing tracks.
Finally, click Invite User.
On the confirmation popup, click Send invite.
On the next page, click Manage. This will open the the App permissions tab.
Click on Add app and choose your app. Click Apply.
Click Apply.
Finally, click Save changes. Click Yes.
Open the service account key file you downloaded and add its contents as a GitHub Secret named PLAY_SERVICE_ACCOUNT_JSON.
The service is now ready and you can automate Play Store uploads.