Auto-push tag and create Gitea release on make patch/minor/major

This commit is contained in:
2026-03-25 15:55:46 +11:00
parent 7d256a999f
commit 677016ca52
+8 -4
View File
@@ -2,7 +2,7 @@ BINARY := node-lookup
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
GOFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
.PHONY: all build test lint clean install patch minor major
.PHONY: all build test lint clean install patch minor major _release
all: build
@@ -31,12 +31,16 @@ _PAT := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f3)
patch:
@NEW=v$(_MAJ).$(_MIN).$(shell expr $(_PAT) + 1); \
git tag $$NEW && echo "Tagged $$NEW"
git tag $$NEW && echo "Tagged $$NEW" && $(MAKE) _release TAG=$$NEW
minor:
@NEW=v$(_MAJ).$(shell expr $(_MIN) + 1).0; \
git tag $$NEW && echo "Tagged $$NEW"
git tag $$NEW && echo "Tagged $$NEW" && $(MAKE) _release TAG=$$NEW
major:
@NEW=v$(shell expr $(_MAJ) + 1).0.0; \
git tag $$NEW && echo "Tagged $$NEW"
git tag $$NEW && echo "Tagged $$NEW" && $(MAKE) _release TAG=$$NEW
_release:
git push origin $(TAG)
tea releases create --tag $(TAG) --title $(TAG)