Release Process
This document outlines the release process for the fdm monorepo. Our process is built on a development -> release -> main branching strategy and is automated using GitHub Actions and Changesets.
Overview
The core idea is to separate the development of features from the release of new versions.
developmentbranch: This is the primary integration branch where all new features and bug fixes are merged. Pushing to this branch automatically publishes adevelopmentsnapshot version for testing.release/*branches: These branches are created fromdevelopmentto prepare for a new stable release. This is where final release chores (like updating documentation, blog posts, etc.) are performed.mainbranch: This branch represents the latest stable production code. Merging arelease/*branch intomaintriggers the publication of stable packages to the registry and the creation of official GitHub Releases.
For Developers: Making a Change
When you contribute code that should result in a new version of one or more packages, you must include a "changeset".
- Make your code changes on a feature branch as usual.
- Run
pnpm changeset. This will launch an interactive CLI. - Select the packages you have changed using the arrow keys and spacebar.
- Choose the version bump type (Major, Minor, or Patch) for each selected package.
- Write a clear summary of the change. This summary will be used to generate the
CHANGELOG.mdfor the packages. - Commit the new changeset file (e.g.,
.changeset/unique-name.md) along with your code changes. - Open a pull request to the
developmentbranch.
Once your PR is merged into development, the automation will take over and publish a snapshot release.
For Release Managers: Creating a New Release
Follow these steps to create a new stable release.
Step 1: Create the Release Branch
Create a new release/* branch from the development branch.
git checkout development
git pull origin development
git checkout -b release/[YYYY-MM]
Step 2: Perform Release Chores
On this release/* branch, you can perform any final tasks before the release. This is the time to:
- Add or update blog posts.
- Update a "What's New" section in the application.
- Run code formatters or linters.
- Perform any other final checks or documentation updates.
You can make and push as many commits as you need for these chores. The automation will not interfere.
Step 3: Finalize and Version the Release
When you are 100% certain the release branch is complete and ready, you must manually trigger the versioning process.
- Go to the Actions tab in the GitHub repository.
- Select the Release workflow from the list on the left.
- Click the Run workflow dropdown.
- Select your
release/[YYYY-MM]branch from the "Branch" dropdown. - Click the green Run workflow button.
This will trigger the Version Packages job, which adds a final commit to your branch containing all the version bumps, changelog updates, and Git tags.
Step 4: Merge to Main
- Open a pull request from your
release/[YYYY-MM]branch to themainbranch. - The PR will have a
Verify Versioningstatus check. This check must pass before you can merge. It fails if the versioning commit from the previous step is not present. - A bot will also add a comment to the PR reminding you of the process.
- Once all checks pass, merge the pull request.
Merging into main will trigger the final step of the automation, which publishes the stable packages and creates the GitHub Releases.
Step 5: Merge Main Back to Development
This is a critical final step. To ensure the development branch receives the latest version bumps and changelogs from the release, you must merge main back into development.
git checkout development
git pull origin development
git merge --no-ff main
git push origin development
For Release Managers: Creating a Hotfix
A hotfix is used to patch a critical bug in production. The process is similar to a regular release, but it starts from the main branch.
-
Create the Hotfix Branch: Create a
hotfix/*branch from themainbranch.git checkout main
git pull origin main
git checkout -b hotfix/fix-critical-bug -
Make and Commit Changes: Apply the necessary code changes to fix the bug. Remember to add a changeset for the patch by running
pnpm changeset. -
Finalize and Version the Hotfix: Just like a release branch, when the hotfix is ready, you must manually trigger the versioning process from the Actions tab on your
hotfix/*branch. -
Merge to Main: Open a pull request from your
hotfix/*branch tomain. The same status checks and comments will apply. Merging this will publish the patched version. -
Merge back to Development: This is a critical step. To ensure the fix is not lost, you must also merge the
mainbranch back into thedevelopmentbranch.git checkout development
git pull origin development
git merge --no-ff main
git push origin development