Course contentsShow
← React Native
Lesson 101 of 1,5552. Project Scaffolding with ExpoFree lesson

Automated Versioning and Changelog Generation

Implement standard versioning processes integrated with the mobile build cycle.

In this lesson, you will learn how to automate your project's versioning and changelog updates to ensure your release cycle remains consistent and error-free.

The Problem with Manual Versioning

When building apps with Expo, you track your app version in the app.json file. Manually updating this file and writing release notes every time you push an update to the App Store or Google Play is prone to human error. If you forget to increment the version number, your store submission will be rejected.

Automated Versioning

To solve this, we use standard versioning patterns (like SemVer: Major.Minor.Patch). Instead of typing these numbers yourself, you can integrate tools into your CLI workflow that increment the version automatically based on your commit history.

For example, when you prepare a release, a script can trigger a tool like standard-version. This tool inspects your commit messages to determine if the update is a "fix" (patch), a "feature" (minor), or a "breaking change" (major). It then automatically updates your app.json and package.json files.

Generating the Changelog

A changelog is a file that lists the changes made in each version. By enforcing a naming convention for your commits (known as "Conventional Commits"), the automation tool can parse your history and generate a CHANGELOG.md file for you automatically.

// Example of how your app.json version property stays in sync
{
  "expo": {
    "name": "MyProject",
    "version": "1.2.3", 
    "ios": { "buildNumber": "1.2.3" }
  }
}

By adding a script to your package.json, you can trigger this process before you run your build:

"scripts": {
  "release": "standard-version"
}

When you run npm run release, the tool reads your commit logs, updates the version field in app.json automatically, and generates a formatted list of all your recent changes. This ensures that every time you trigger a new build via EAS, your project metadata is perfectly aligned with your actual code history.

Key Takeaway: By using Conventional Commits and automated scripts, you eliminate human error from your release process, ensuring that your app versions and changelogs are always accurate and synchronized.