Automating Version Updates in Your React Native Codebase (Expo)
I’ve been working on a exciting project called Apprecimate, where we’re building a mobile app from the ground up using Expo. Given that our application is under active development, we find ourselves deploying updates almost daily. It’s not uncommon for us to occasionally overlook updating the version, or even miss updating it across all necessary files. To minimize such errors and streamline our process, I’ve decided to automate these version updates and integrate them into our CI/CD pipeline.
The versions need to be updated:
- Version in
package.json
- Version in
app.json
- iOS build number in
app.json
- Android versionCode in
app.json
Here are the examples of these files before version update:
package.json:
{
"name": "apprecimate",
"version": "1.0.0",
"description": "Recognize, Motivate, Appreciate! ",
// ... rest of your package.json data
}
app.json:
{
"expo": {
"name": "apprecimate",
"slug": "apprecimate",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain"…