Add make tag for release tagging

- `prerelease`: version-consistency grep across CHANGELOG, install,
  install.ps1, and both man pages (extracted from `release` target)
- `tag`: depends on `prerelease`; signs and pushes the version tag
- RELEASE.md: replace manual tag/push steps with `make tag`
This commit is contained in:
Junegunn Choi
2026-05-24 01:19:01 +09:00
parent 5e137613d3
commit 3953d1c649
2 changed files with 24 additions and 9 deletions
+14 -1
View File
@@ -117,6 +117,19 @@ generate:
build: build:
goreleaser build --clean --snapshot --skip=post-hooks goreleaser build --clean --snapshot --skip=post-hooks
prerelease:
# Check if version numbers are properly updated
grep -q ^$(VERSION_REGEX)$$ CHANGELOG.md
grep -qF '"fzf $(VERSION_TRIM)"' man/man1/fzf.1
grep -qF '"fzf $(VERSION_TRIM)"' man/man1/fzf-tmux.1
grep -qF $(VERSION) install
grep -qF $(VERSION) install.ps1
@echo "OK: all files consistent at $(VERSION)"
tag: prerelease
git tag -s v$(VERSION) -m v$(VERSION)
git push origin v$(VERSION)
release: release:
# Make sure that the tests pass and the build works # Make sure that the tests pass and the build works
TAGS=tcell make test TAGS=tcell make test
@@ -206,4 +219,4 @@ update:
$(GO) get -u $(GO) get -u
$(GO) mod tidy $(GO) mod tidy
.PHONY: all generate build release test itest bench lint install clean docker docker-test update fmt .PHONY: all generate build prerelease tag release test itest bench lint install clean docker docker-test update fmt
+10 -8
View File
@@ -15,18 +15,20 @@ triggered by a tag push.
- `man/man1/fzf.1` - `man/man1/fzf.1`
- `man/man1/fzf-tmux.1` - `man/man1/fzf-tmux.1`
2. Sign and push the tag. 2. Verify file consistency, sign the tag, and push the tag.
```sh ```sh
export V=v0.73.0 make tag VERSION=0.73.0
git tag -s $V -m $V
# Push the tag only. master on origin still points to the old version,
# so /master/install keeps resolving against existing binaries during
# the publish window.
git push origin $V
``` ```
`make tag` runs `prerelease` first (checks that the version
appears in CHANGELOG.md, both man pages, install, and install.ps1)
and only signs + pushes the tag if the checks pass.
Only the tag is pushed; `master` on origin still points to the
old version, so `/master/install` keeps resolving against existing
binaries during the publish window.
3. The workflow fires on the tag push and pauses on the `release` 3. The workflow fires on the tag push and pauses on the `release`
environment gate. Approve it in the Actions tab to release. environment gate. Approve it in the Actions tab to release.