Skip to content

Commit

Permalink
Minor updates to release procedures docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jul 3, 2024
1 parent 801d125 commit abfa786
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,71 @@ New releases should be created from release branches originating from the `dev`

- Make sure you've pulled all the changes from GitHub for both `dev` and `main` branches.
- Check out the `dev` branch.
- Create a new release branch with the `release-` prefix (eg, `git checkout -b release-next`).
- **IMPORTANT:** The `release-` prefix is important, as this is what triggers our GitHub CI workflow that will ultimately publish the release.
- Branches named `release-experimental` will not trigger our release workflow, as experimental releases handled differently (outlined below).
- Create a new `release-next` branch (eg, `git checkout -b release-next`).
- Technically, any `release-*next*` branch name will work as this is what triggers our GitHub CI workflow that will ultimately publish the release - but we just always use `release-next`
- Merge `main` into the release branch.

Changesets will do most of the heavy lifting for our releases. When changes are made to the codebase, an accompanying changeset file should be included to document the change. Those files will dictate how Changesets will version our packages and what shows up in the changelogs.

### Starting a new pre-release

- Ensure you are on the new `release-*` branch.
- Ensure you are on the new `release-next` branch.
- Enter Changesets pre-release mode using the `pre` tag: `pnpm changeset pre enter pre`.
- Commit the change and push the `release-*` branch to GitHub.
- Commit the change and push the `release-next` branch to GitHub.
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs.
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR into the `release-*` branch.
- Check out the PR branch created by changesets locally
- Review the updated `CHANGELOG.md` files in the PR locally and make any adjustments necessary, then merge the PR into the `release-next` branch.
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;`
- Once the PR is merged, the release workflow will publish the updated packages to npm.
- Once the changesets files are in good shape, merge the PR to `release-next`
- Once the PR is merged, the release workflow will publish the updated `X.Y.Z-pre.*` packages to npm.
- At this point, you can begin crafting the release notes for the eventual stable release in the root `CHANGELOG.md` file in the repo
- Copy the template for a new release and update the version numbers and links accordingly
- Copy the relevant changelog entries from all packages into the release notes and adjust accordingly
- Commit these changes directly to the `release-*` branch - they will not trigger a new prerelease since they do not include a changeset
- Commit these changes directly to the `release-next` branch - they will not trigger a new prerelease since they do not include a changeset

### Iterating a pre-release

You may need to make changes to a pre-release prior to publishing a final stable release. To do so:

- Make whatever changes you need.
- Branch off of `release-next` and make whatever changes you need
- Create a new changeset: `pnpm changeset`.
- **IMPORTANT:** This is required even if you ultimately don't want to include these changes in the logs. Remember, changelogs can be edited prior to publishing, but the Changeset version script needs to see new changesets in order to create a new version.
- Commit the changesets and push the `release-*` branch to GitHub.
- Push your branch to GitHub and PR it to `release-next`.
- Once reviewed/approved, merge the PR to the `release-next` branch.
- Wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions.
- Review the PR, make any adjustments necessary, and merge it into the `release-*` branch.
- Once the PR is merged, the release workflow will publish the updated packages to npm.
- Review the PR, make any adjustments necessary, and merge it into the `release-next` branch.
- Once the PR is merged, the release workflow will publish the updated `X.Y.Z-pre.*` packages to npm.
- Make sure you copy over the new changeset contents into stable release notes in the root `CHANGELOG.md` file in the repo

### Publishing the stable release

- Exit Changesets pre-release mode: `pnpm changeset pre exit`.
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-*` branch to GitHub.
- Exit Changesets pre-release mode in the `release-next` branch: `pnpm changeset pre exit`.
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-next` branch to GitHub.
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs for the stable release.
- Review the updated `CHANGELOG` files and make any adjustments necessary.
- Review the updated `CHANGELOG` files in the PR and make any adjustments necessary.
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;`
- Our automated release process should have removed prerelease entries
- Finalize the release notes
- This should already be in pretty good shape in the root `CHANGELOG.md` file in the repo
- Do a quick double check that all iterated prerelease changesets got copied over
- Merge the PR into the `release-*` branch.
- Merge the PR into the `release-next` branch.
- Once the PR is merged, the release workflow will publish the updated packages to npm.
- Once the release is published:
- Pull the latest `release-*` branch containing the PR you just merged
- Merge the `release-*` branch into `main` **using a non-fast-forward merge** and push it up to GitHub
- `git checkout main; git merge --no-ff release-next`
- Merge the `release-*` branch into `dev` **using a non-fast-forward merge** and push it up to GitHub
- `git checkout dev; git merge --no-ff release-next`
- Pull the latest `release-next` branch containing the PR you just merged
- Merge the `release-next` branch into `main` **using a non-fast-forward merge** and push it up to GitHub
- `git checkout main`
- `git merge --no-ff release-next`
- `git push origin main`
- Merge the `release-next` branch into `dev` **using a non-fast-forward merge** and push it up to GitHub
- `git checkout dev`
- `git merge --no-ff release-next`
- `git push origin dev`
- Convert the `react-router@6.x.y` tag to a Release on GitHub with the name `v6.x.y` and add a deep-link to the release heading in `CHANGELOG.md`
- Delete the `release-next` branch locally and on GitHub

### Hotfix releases

Hotfix releases follow the same process as standard releases above, but the `release-*` branch should be branched off latest `main` instead of `dev`. Once the stable hotfix is published, the `release-*` branch should be merged back into both `main` and `dev` just like a normal release.
Hotfix releases follow the same process as standard releases above, but the `release-next` branch should be branched off latest `main` instead of `dev`. Once the stable hotfix is published, the `release-next` branch should be merged back into both `main` and `dev` just like a normal release.

### Experimental releases

Expand Down

0 comments on commit abfa786

Please sign in to comment.