Rewrite release instructions as an ordered checklist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andy Dixon
2026-10-02 11:03:55 +01:00
co-authored by Claude Opus 5.5
parent b009ac3cbf
commit c150ad844a
2 changed files with 34 additions and 24 deletions
+33 -23
View File
@@ -9,35 +9,45 @@ make race # go test -race ./...
make vet fmt-check make vet fmt-check
make benchmark # go test -bench make benchmark # go test -bench
make fuzz # short fuzz runs of snapshot / treemap / filter make fuzz # short fuzz runs of snapshot / treemap / filter
make release # cross-compiled binaries in bin/release make release # release archives and packages in bin/release
``` ```
## Releasing ## Releasing
```sh Example for 1.2.0; substitute the real version throughout.
git tag -a v1.0.0 -m "mapsize 1.0.0"
make release # bin/release: archives, .deb/.rpm/.apk/Arch, SHA256SUMS
```
The version comes from `git describe` and is stamped into 1. Update the version in `internal/brand/brand.go` and `docs/mapsize.1`,
`brand.Version`; untagged builds report the fallback in and add a `## 1.2.0` section to CHANGELOG.md. Commit.
`internal/brand/brand.go`. Packages need network access the first time 2. Tag and push:
(`nfpm` is fetched with `go run`). Bump the version in `docs/mapsize.1` and ```sh
`brand.go` and add a CHANGELOG section before tagging. git tag -a v1.2.0 -m "mapsize 1.2.0"
git push origin master v1.2.0
```
3. Build everything (archives, .deb/.rpm/.apk/Arch packages, SHA256SUMS
into `bin/release`; the first run downloads `nfpm`):
```sh
make release VERSION=v1.2.0
```
4. Publish the GitHub release with the changelog section as notes:
```sh
awk '/^## 1.2.0/{f=1;next} /^## /{f=0} f' CHANGELOG.md > /tmp/notes.md
gh release create v1.2.0 --title v1.2.0 --notes-file /tmp/notes.md bin/release/*
```
5. Update Homebrew. This needs the tag pushed (step 2), because it
checksums GitHub's source tarball for that tag:
```sh
make brew-formula VERSION=v1.2.0 # writes bin/homebrew/mapsize.rb
git clone https://github.com/andydixon/homebrew-tap /tmp/tap
cp bin/homebrew/mapsize.rb /tmp/tap/Formula/mapsize.rb
git -C /tmp/tap commit -am "mapsize 1.2.0" && git -C /tmp/tap push
```
Users get it with `brew upgrade mapsize`. Template:
`packaging/homebrew/mapsize.rb.in`.
### Homebrew Always pass `VERSION=`: otherwise it comes from `git describe`, which only
matches the tag when HEAD is exactly the tagged commit. `make release` and
After pushing the tag: the Homebrew formula stamp the version into the binary; `make build` and
`go install` use the value in `brand.go`, which is why step 1 updates it.
```sh
make brew-formula # → bin/homebrew/mapsize.rb with the tarball's sha256
```
Copy the result to `Formula/mapsize.rb` in the tap repository
`github.com/andydixon/homebrew-tap`; users then run
`brew install andydixon/tap/mapsize`. The formula builds from source with
Go, stamps the version and installs the man page. Template:
`packaging/homebrew/mapsize.rb.in`.
The snapshot format is stable at version 1: a format change must bump The snapshot format is stable at version 1: a format change must bump
`snapshot.Version` and keep the reader for version 1. `snapshot.Version` and keep the reader for version 1.
+1 -1
View File
@@ -75,7 +75,7 @@ go install github.com/andydixon/mapsize/cmd/mapsize@v1.0.0
make build # → bin/mapsize make build # → bin/mapsize
sudo make install # binary + man page under /usr/local (PREFIX=… to change) sudo make install # binary + man page under /usr/local (PREFIX=… to change)
# Homebrew (macOS and Linux), once the tap is published # Homebrew (macOS and Linux)
brew install andydixon/tap/mapsize brew install andydixon/tap/mapsize
``` ```