build: add release pipeline targets to Makefile

Add tag, gitea-release, and release targets to encode the corrected
versioning process (no v-prefix). VERSION is now overridable via the
command line for use in make release VERSION=x.y.z.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 22:21:11 -04:00
parent 9cd4af9bb6
commit 66bd7ba43a

View File

@@ -1,9 +1,10 @@
BIN := yoink BIN := yoink
BUILD_DIR := build BUILD_DIR := build
REGISTRY := git.brizzle.dev/bryan/yoink-go REGISTRY := git.brizzle.dev/bryan/yoink-go
VERSION := $(shell git describe --tags --always --dirty) VERSION ?= $(shell git describe --tags --always --dirty)
NOTES ?= ""
.PHONY: all windows linux darwin clean docker-build docker-push .PHONY: all windows linux darwin clean docker-build docker-push tag gitea-release release
all: windows linux darwin all: windows linux darwin
@@ -28,5 +29,28 @@ docker-push: docker-build
podman push $(REGISTRY):$(VERSION) podman push $(REGISTRY):$(VERSION)
podman push $(REGISTRY):latest podman push $(REGISTRY):latest
tag:
@if [ -z "$(VERSION)" ]; then echo "Usage: make tag VERSION=1.2.0"; exit 1; fi
git tag $(VERSION)
git push origin $(VERSION)
gitea-release:
tea release create \
--tag $(VERSION) \
--title "$(VERSION)" \
--note $(NOTES) \
--asset $(BUILD_DIR)/$(BIN)-windows-amd64.exe \
--asset $(BUILD_DIR)/$(BIN)-linux-amd64 \
--asset $(BUILD_DIR)/$(BIN)-linux-arm64 \
--asset $(BUILD_DIR)/$(BIN)-darwin-amd64 \
--asset $(BUILD_DIR)/$(BIN)-darwin-arm64
release:
@if [ -z "$(VERSION)" ]; then echo "Usage: make release VERSION=1.3.0 NOTES='...'"; exit 1; fi
$(MAKE) tag VERSION=$(VERSION)
$(MAKE) clean all
$(MAKE) gitea-release VERSION=$(VERSION) NOTES=$(NOTES)
$(MAKE) docker-push VERSION=$(VERSION)
clean: clean:
rm -rf $(BUILD_DIR) rm -rf $(BUILD_DIR)