Create Google Play Service account
Part III — Automate App release to Google Play | Story 1 — Creating Google Play Service account
In the previous two parts of this series, we saw how to:
- create a React Native app from scratch,
- add Typescript to the react-native project to allow us to develop the app using Typescript if we prefer
- create upload key and bundle React Native app’s Android version to create its
.aab
file and - register app on Google Play console and manually release/publish it to Google Play store.
In this post, we will see how to automate the bundling and publishing the app to Google Play store using Gitlab’s CI/CD and Gradle Play Publisher (GPP)
As described on its Github page — Gradle Play Publisher is Android’s unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
Creating Google Play Service account
To allow GPP to access our Google Play account to release and publish the app, we will need create a service account in our Google Play Developer console.
- Go and login to the Google Cloud Platform (GCP) Console.
- Create a new project in GCP console if you don’t have one
- On GCP console, from the projects list at the top bar, select the project you created or for which you would like to create service account.
- From left side menu, select IAM & Admin — Service Accounts and click Create Service Account
- Create service account form appears, enter a name and description for the service account being created and click ‘Create’ button 👇
- On the next page, select Owner for the Role for the service account and click “Continue” button
- In the following screen, the optional section — Grant users access to this service account, can be left blank.
- Click “Done” on next screen 👇
Once you click Done button above, the service account would be created and you would be navigated back to Service accounts list page which should now show the new service account we created above in the list 👇.
Click on the three dots in the row of our new service account and select ‘Create Key’ from the pop-up menu 👇
The key file would be downloaded as a JSON file. A message would pop up saying the key has been saved to the computer 👇
Move the file to some secured folder and rename if you prefer. I usually store in my dropbox cloud drive and name it something like — serviceAccount2-privateKey.json
📌 🅳🅾🆆🅽🅻🅾🅰🅳 1 : serviceAccount2-privateKey.json
Granting permission to Service account for Google Play service
Now that we have the service account created on Google Cloud platform, we need to give this account permission on our Google Play Developer console to manage our app.
- Go/login to your Google Play Console account
- Go to Settings → Developer Account → API Access
Here, under Service Accounts section, the account we created above should be listed(refresh page if you are not seeing it)
Click on the ‘Grant Access’ button next to our service account 👇
Add new user pop-up form would appear as below 👇
- Select ‘Administrator’ for the role of the service account.
- Select the app that we want to manage with the selected service account.
- Select the access levels as below (default selected)
- Click Add User/Save button.
On click of Add User button, you would be navigated to Users & Permissions → Users with Access page. Here you would see the service account listed👇
Enable Google Play Android developer API for the GCP project
Go to AndroidPublisher API ,
From the top bar, select the GCP project to which we added the service account in above section.
Enable the Google Play Android developer API for that GCP project
Awesome, we are done with the configuration needed on GCP and Google play developer console.
In the next post, we go back to code side to make few changes to our app’s android project and add .gitlab-ci.yml
.
←Prev: Release app manually
┈ 🏠 ┈ Next:Gitlab vars and yml file
→