Skip to content

Commit c0ce87b

Browse files
docs(dev): clarify release procedure and document script dependencies
1 parent 3004cda commit c0ce87b

1 file changed

Lines changed: 43 additions & 11 deletions

File tree

docs/dev/developer-guide.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -691,16 +691,48 @@ Nextclade project tries hard to adhere to [Semantic Versioning 2.0.0](https://se
691691
- See the table in [Deployment environments](./developer-guide.md#deployment-environments)
692692
- Typically you aggregate the latest features on `master`, the occasionally push them to `staging` and finally to the `release`. So it's a pipeline. You almost never want your `release` or `staging` branch to be out-of sync with `master`, by e.g. having random things on `release`, but not on `master`.
693693

694+
###### Release script dependencies
695+
696+
The release script (`./scripts/release`) requires the following tools:
697+
698+
- [`dasel`](https://github.com/TomWright/dasel) - reads version numbers from TOML/YAML files
699+
- [`jq`](https://jqlang.github.io/jq/) - updates `package.json` version
700+
- [`cargo-edit`](https://github.com/killercup/cargo-edit) - provides `cargo set-version` for bumping `Cargo.toml` versions. Install with `cargo install cargo-edit`.
701+
694702
###### Release procedure
695703

696-
- Checkout `master` branch.
697-
- Make sure to fill the `CHANGELOG.md` and commit changes locally. It should start with a section named exactly `## Unreleased`, under which you list all the changes in this release.
698-
- Make sure there are no uncommitted changes.
699-
- Follow comments in the script `./scripts/release` on how to install dependencies for this script.
700-
- Run `./scripts/release <bump_type>`, where `bump_type` signifies by how much you want to increment the version. It should be one of: `major`, `minor`, `patch`, `rc`, `beta`, `alpha`. Note that `rc`, `beta` and `alpha` will make a prerelease, that is - marked as "prerelease" on GitHub Releases and not overwriting "latest" tags on DockerHub.
701-
- Verify the changes the script applied:
702-
- versions are bumped in all `Cargo.toml` files (one at the root and one for each package) and the root`Cargo.lock` file.
703-
- version is bumped in `package.json` file.
704-
- a local commit created on branch `master` with a message containing the version number that you expect
705-
- The script will provide instructions on how to push the changes. You can push to `master`, or fast-forward either `staging` or `release` to `master` and then push to `staging` or `release`. A push to any of these branches will trigger CI deployment to the corresponding environment. Most often you push the release commit to all 3 major branches.
706-
- The script is not fool-proof and will break easily if you try. Don't!
704+
1. Checkout `master` branch. Make sure all changes intended for the release are already merged.
705+
706+
2. Edit `CHANGELOG.md`: add a new section at the top named exactly `## Unreleased`, listing all user-visible changes in this release. Do **not** commit the changelog - the release script will include it in the release commit automatically. The script's dirty-check explicitly allows uncommitted `CHANGELOG.md` changes.
707+
708+
3. Make sure there are no other uncommitted changes (the script will reject them).
709+
710+
4. Run `./scripts/release <bump_type>`, where `bump_type` is one of: `major`, `minor`, `patch`, `rc`, `beta`, `alpha`. The `rc`, `beta` and `alpha` types create a prerelease (marked as "prerelease" on GitHub Releases and not overwriting "latest" tags on DockerHub).
711+
712+
The script will:
713+
- Validate preconditions (clean working directory, correct branch, lockfile sync, `## Unreleased` section exists)
714+
- Bump versions in all `Cargo.toml` files, `Cargo.lock`, and `package.json`
715+
- Replace `## Unreleased` in `CHANGELOG.md` with the new version number
716+
- Create a local commit `chore: release <version>` containing all of the above
717+
718+
5. Verify the release commit: check that versions, changelog heading, and lockfiles look correct.
719+
720+
6. Push to the target environments. Most often, push the release commit to all 3 major branches:
721+
722+
```bash
723+
git push origin master
724+
725+
git checkout staging
726+
git merge --ff-only master
727+
git push origin staging
728+
729+
git checkout release
730+
git merge --ff-only master
731+
git push origin release
732+
733+
git checkout master
734+
```
735+
736+
A push to any of these branches triggers CI deployment to the corresponding environment (see the [deployment environments table](#deployment-environments)).
737+
738+
> ⚠️ The script is interactive and will ask for confirmation before proceeding. It is not fool-proof and will break easily if you try. Don't!

0 commit comments

Comments
 (0)