In Open Event Android we are using fastlane to automate the process of releasing the app to the Play Store, otherwise without this tool we would have to sign the release apk everytime before making a release but with fastlane all we need to do is just merge the development branch with the master branch and the updated app is released in Play Store.
The first thing that we need to do is encrypt the signing keys and upload it to the repository so we will create an encrypted tar file of the signing keys and upload it to the repository.
Now we want to decrypt the tar file everytime we merge our development branch into the master branch. We will create a bash script which does the above task which looks like this.
We need to define all these variables written after the $ sign as our Travis environment variables.
Next thing that we need to do is sign the apk so first thing that we check in the update-apk script is if we are on the master branch. We take the unsigned apk and sign it with the following commands.
The following command zipaligns the app
After signing the release apk, the final step is to publish the app to the playstore. The following command will install fastlane.
This command will take the signed apk and upload it in alpha channel of the playstore.
That’s it! Now releasing an update to the playstore is as simple as sending a pull request to the master branch. A process that would have otherwise required few minutes has been reduced to just seconds.
- Fastlane Official Site: https://fastlane.tools/
- Fastlane Android Documentaion: https://docs.fastlane.tools/getting-started/android/release-deployment/
- Fastlane Repository: https://github.com/fastlane/fastlane