Makefile: fix help output and annotated release tags
- fix `make help` printing "Makefile" instead of target names — caused by `include tools.versions` adding to MAKEFILE_LIST; grep now targets Makefile directly - `make release` now creates annotated tags: pre-populates the message with commits since the previous tag and opens $EDITOR for review Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5055d69685
commit
fd9621669c
15
Makefile
15
Makefile
@ -9,7 +9,7 @@ CMD_PATH := ./cmd/app
|
||||
|
||||
# ── Default target ─────────────────────────────────────────────────────────────
|
||||
help: ## Show this help message
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | \
|
||||
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}' | sort
|
||||
|
||||
# ── First-time setup ───────────────────────────────────────────────────────────
|
||||
@ -82,7 +82,18 @@ ifdef VERSION
|
||||
$(MAKE) test-race
|
||||
$(MAKE) lint
|
||||
$(MAKE) security
|
||||
git tag $(VERSION)
|
||||
@MSG=$$(mktemp); \
|
||||
LAST=$$(git describe --tags --abbrev=0 2>/dev/null); \
|
||||
echo "$(VERSION)" > $$MSG; \
|
||||
echo "" >> $$MSG; \
|
||||
if [ -n "$$LAST" ]; then \
|
||||
echo "Changes since $$LAST:" >> $$MSG; \
|
||||
git log $$LAST..HEAD --oneline >> $$MSG; \
|
||||
else \
|
||||
git log --oneline >> $$MSG; \
|
||||
fi; \
|
||||
git tag -a -e -F $$MSG $(VERSION); \
|
||||
rm -f $$MSG
|
||||
git push origin $(VERSION)
|
||||
else
|
||||
@echo "Released versions:"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user