Skip to content

Deploy Android App on Play Store using Github Action

Published:

Table of content

Introduction

The app release process is a repeatative process and take too much time to version bump, build and upload it to play store or other app stores.

To simplify the process I’ve automated this process in my project KeyPass using Github Actions.

Requirements

For most of the apps we have these requirements, there may be different requirements for your app.

  1. Bump type:
  1. Release Notes: Update the release note for each release.

Prerequisites

End-to-End Process

How to trigger

We have the manual trigger to initiate the release process, we have few parametrs to start the release.
Link to Github Workflow file. Trigger

Bump App Version & Update Release Notes

In android we are having 2 variables to store the version of the app.

On trigger we fetch the current version from build.gradle file where versionCode and versionName is mentioned, then we update the version code and version name and we will write the release notes using this script.

Commit and merge the changes.

In last step we bump the version and modified the release notes, but we have to merge it to master so next time when we do the version bump it will pick the correct version from master.

Create Github Tag & release

After merging the changes to master, we create the tag and release from the tag, the release can be used in future if want to check the change logs or code that we shipped in that specific release.

Generate AAB file

We have created another workflow, this workflow will create the AAB file and upload the AAB to play store and Indus app store. This workflow will be triggered whenever there is a new release is created on github.

Upload on Play Store

Once the build is created the build will be uploaded on play store using r0adkll/upload-google-play@v1.1.3 github action.

We can customize the github action to deploy the build on our desired channel like production, beta, alpha, etc.

Additional Considerations

Stop deployment

When the build is in progress we can stop the github workflow to stop the build process in between.

Revert the release

There is no direct option supported by play store to revert the release, instead we have to re-release a new version with changes reverted.

Conclusion

By integrating this process there are several benefits we will get like reduce manual work to build and deploy will also lead to less manual errors, log of all the releases.


Next Post
Automating Indus App Store Uploads with GitHub Actions