We have a dedicated release branch, latest-release
, off of which we create our releases using our release script. Once we're ready to release, we reset the latest-release
branch to main
and create a pre-release with the script. If there are issues with the pre-release, we merge the fixes to main
and cherry-pick them to the latest-release
branch. We repeat this process until all issues have been resolved and we can make a proper release.
This procedure allows us to continue merging features into main
without them being included in the release.
On every merge to main
we also publish an unstable release with the version edge-bonsai
that is always flagged as a pre-release.
The release script has the signature:
./scripts/release.ts <minor | patch | preminor | prepatch | prerelease> [--force] [--dry-run]
and does the following:
- Checks out a branch named
release-<version>
. - Updates
core/package.json
,core/package-lock.json
andCHANGELOG.md
. - Commits the changes, tags the commit, and pushes the tag and branch.
- Pushing the tag triggers a CI process that creates the release artifacts and publishes them to GitHub. If the release is not a pre-release, we create a draft instead of actually publishing.
To make a new release, set your current working directory to the garden root directory and follow the steps below.
First, you need to prepare the release binaries and run some manual tests:
- Checkout to the
latest-release
branch. - Reset
latest-release
tomain
withgit reset --hard origin/main
- Run
git log
to make sure that the latest commit is the expected one and there are no unwanted changes frommain
included in the release. - Run
./scripts/release.ts patch
. This way, the version bump commits and changelog entries created by the pre-releases are omitted from the final history. - Wait for the CI build job to get the binaries from the GitHub Releases page.
Once the release CI job is done, a draft release will appear in GitHub. That draft release should be published and announced:
- Go to our GitHub Releases page and click the Edit button for the draft just created from CI. Note that for drafts, a new one is always created instead of replacing a previous one.
- Write release notes. The notes should give an overview of the release and mention all relevant features. They should also acknowledge all external contributors and contain the changelog for that release.
- Run
./scripts/draft-release-notes.ts <previous-tag> <current-tag>
, the filename with the draft notes will be printed in the console - Open the draft file (it's named
release-notes-${version}-draft.md
, e.g.release-notes-0.12.38-draft.md
) and resolve all suggested TODO items
- Click the Publish release button.
- Make a pull request for the branch that was pushed by the script and make sure it's merged as soon as possible.
- Update the
CHANGELOG.md
if manual changes in the release nodes were necessary (e.g. removing commits that were reverted). - Run
npm install
and commit the updatedpackage-lock.json
. - Make sure the
latest-release
branch contains the released version, and push it to the remote. This branch is used for our documentation, so this step is important. - Check the
update-homebrew
GitHub Action run successfully and merge the relevant PR in the homebrew repo. Use regular merge with the merge commit. - Install the Homebrew package and make sure it works okay:
brew tap garden-io/garden && brew install garden-cli || true && brew update && brew upgrade garden-cli
- Run
$(brew --prefix garden-cli)/bin/garden dev
(to make sure you're using the packaged release) in an example project and see if all looks well.
- Prepare the release announcement and publish it in our channels (Discord and Twitter). If not possible, delegate the task to an available contributor.