This content originally appeared on DEV Community and was authored by Jeiman Jeya
NOTE: This tool/implementation is useful for when you have both iOS and Android binary applications residing within the same repository (usually a React Native application) or hybrid app development tools which produce iOS and Android apps. However, it can be customisable to your needs with a little re-configuration.
The Story
Imagine if we could automate the entire app versioning process for our mobile applications by just typing in whether you want to bump it by:
- Major
- Minor
- or Patch
Imagine if you don’t have to worry about the app versioning process of knowing what is already in production and what version we need to bump it to?
Lo and behold, the App Release Management (ARM) tool. ?
NOTE: Semantic versioning MAJOR, MINOR, and PATCH is the de facto standard you use to version your applications. Please refer to this link to find out more about SemVer standards.
Fancy word, but what does it actually do?
It pretty much does what is mentioned above. The process is as follows:
- It will fetch the latest versions from TestFlight and Google Play Console respectively.
- It will show you a summary of what the versions are.
- If both Android and iOS match, the tool will select either one of them to use as the base of bumping the version.
- The tool will prompt you whether you would like to bump it based on major, minor, or patch
- Based on the input, the tool will run a SemVer operation in calculating the next iteration in the version and display the results for you.
- If you’re happy with the result, you may press yes to proceed.
- It will update the following files for you:
package.json
android/app/build.gradle
ios/ProjectName.xcodeproj/project.pbxproj
- Operation completed!
It all looks fancy, but why this approach?
Well, imagine if you are a product owner or a new engineer who is new to the application code and is required to manage the App Releases. This tool will aid them in completing their task with ease, without worrying about configuring the wrong version code bump by accident.
Ok cool, how do I set it up?
- Please refer to the documentation README file for detailed instructions on how to set up the tool.
- Clone the devops-fun repository.
- Once completed, navigate to development > app-release-management-tool folder.
- Ensure that the
.env
file is present before proceeding any further. Refer to the README file for more information. - Run
fastlane
command. - Choose Option 1.
- The rest are pretty self-explanatory thereafter.
What if I want to manually bump the version via a tool?
You may run the bump-version.sh
and pass in a version code as an argument: ./development/app-release-management-tool/bump-version.sh 3.2.0
What does it look like?
Based on the image above, the following actions occur:
- It will do a check against your iOS TestFlight build number and Google App Version and identify if the versions match (Please refer to the README.md file on how to set up a service connection to the respective stores in order to retrieve the app details programmatically).
- If they do, it will display your current version in the App stores and will ask you for input, whether you want to bump the major, minor, or patch.
- Based on your input, it will use the
semver.sh
script to perform the necessary version bump according to the Semantic Versioning standards. - If they don't match up, you'll be defaulted to using the
bump-version.sh
which requires manual input of your SemVer for your application - ie./bump-version.sh 2.2.0
I hope this article has proven beneficial and useful to your release management process. If you have any inquiries, please reach out to me. Happy automating your release process! Do leave a comment or recommendations on improving the tool.
Resources
- https://github.com/jeiman/devops-fun
- https://github.com/jeiman/devops-fun/tree/main/development
- https://semver.org/
References
This content originally appeared on DEV Community and was authored by Jeiman Jeya
Jeiman Jeya | Sciencx (2021-08-10T13:22:23+00:00) How To Automate App Releases using Fastlane and SemVer for Hybrid Applications. Retrieved from https://www.scien.cx/2021/08/10/how-to-automate-app-releases-using-fastlane-and-semver-for-hybrid-applications/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.