From 3953d1c649f51b129adac1f065c431320f3db467 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 24 May 2026 01:19:01 +0900 Subject: [PATCH] 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` --- Makefile | 15 ++++++++++++++- RELEASE.md | 18 ++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 0236c64b..acf65c8f 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,19 @@ generate: build: 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: # Make sure that the tests pass and the build works TAGS=tcell make test @@ -206,4 +219,4 @@ update: $(GO) get -u $(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 diff --git a/RELEASE.md b/RELEASE.md index 20600130..f4189905 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -15,18 +15,20 @@ triggered by a tag push. - `man/man1/fzf.1` - `man/man1/fzf-tmux.1` -2. Sign and push the tag. +2. Verify file consistency, sign the tag, and push the tag. ```sh - export V=v0.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 VERSION=0.73.0 ``` + `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` environment gate. Approve it in the Actions tab to release.