From 6e2e7eb19efb9e66a239465d20618d9bec842ed9 Mon Sep 17 00:00:00 2001 From: Hein Date: Fri, 2 Oct 2026 23:41:42 +0200 Subject: [PATCH] feat(release): add rerelease target to move latest tag --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 26d48ed..10ecc5c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all build test test-unit test-integration lint coverage clean install help docker-up docker-down docker-test docker-test-integration start stop release release-version godoc vet fmt fmt-check staticcheck govulncheck check +.PHONY: all build test test-unit test-integration lint coverage clean install help docker-up docker-down docker-test docker-test-integration start stop release release-version rerelease godoc vet fmt fmt-check staticcheck govulncheck check # Binary name BINARY_NAME=relspec @@ -260,5 +260,13 @@ release-version: lint fmt-check ## Run lint and format check, then auto-incremen git push origin HEAD "$$NEXT"; \ echo "Pushed $$NEXT — release workflow triggered" +rerelease: lint fmt-check ## Move the latest tag to HEAD and force push it + @TAG=$$(git describe --tags --abbrev=0 2>/dev/null); \ + if [ -z "$$TAG" ]; then echo "No existing tags found"; exit 1; fi; \ + echo "Moving $$TAG to $$(git rev-parse --short HEAD)"; \ + git tag -f -a "$$TAG" -m "Release $$TAG" HEAD; \ + git push --force origin "$$TAG"; \ + echo "Pushed $$TAG — release workflow triggered" + help: ## Display this help screen @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'