The Exercism CLI uses GoReleaser to automate the release process.
- Install GoReleaser
- Setup GitHub token
- Have a gpg key installed on your machine - it is used for signing the artifacts
Make sure all the recent changes are reflected in the "next release" section of the CHANGELOG.md file. All the changes in the "next release" section should be moved to a new section that describes the version number, and gives it a date.
You can view changes using the /compare/ view: https://github.com/exercism/cli/compare/$PREVIOUS_RELEASE...main
- Create a branch for the new version
- Edit the
Version
constant incmd/version.go
- Update the
CHANGELOG.md
file - Commit the updated version
- Create a PR
Note: It's useful to add the version to the commit message when you bump it: e.g. Bump version to v2.3.4
.
Once the version bump PR has been merged, run the following commands:
VERSION=$(sed -n -E 's/^const Version = "([0-9]+\.[0-9]+\.[0-9]+)"$/\1/p' cmd/version.go)
TAG_NAME="v${VERSION}"
# Test run
goreleaser --skip-publish --snapshot --clean
# Create a new tag on the main branch and push it
git tag -a "${TAG_NAME}" -m "Trying out GoReleaser"
git push origin "${TAG_NAME}"
# [TODO] Push to homebrew
At this point, Goreleaser will have created a draft release at https://github.com/exercism/cli/releases/tag/vX.Y.Z. On that page, update the release description to:
To install, follow the interactive installation instructions at https://exercism.io/cli-walkthrough
---
[modify the generated release-notes to describe changes in this release]
Lastly, test and publish the draft
Next, we'll submit a PR to Homebrew to update the Exercism formula (which is how macOS users usually download the CLI):
cd /tmp && curl -O https://github.com/exercism/cli/archive/vX.Y.Z.tar.gz
cd $(brew --repository)
git checkout master
brew update
brew bump-formula-pr --strict exercism --url=https://github.com/exercism/cli/archive/vX.Y.Z.tar.gz --sha256=$(shasum -a 256 /tmp/vX.Y.Z.tar.gz)
For more information see How To Open a Homebrew Pull Request.
If there are any significant changes, we should describe them on exercism.io/cli.
The codebase lives at exercism/website-copy in pages/cli.md
.