From d53af6b84f308ddc7cbbc84cf3cf4613d53dbdca Mon Sep 17 00:00:00 2001 From: Bryan Bailey Date: Mon, 9 Mar 2026 22:21:11 -0400 Subject: [PATCH] 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. --- Makefile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 90610ba..86d9440 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ BIN := yoink BUILD_DIR := build 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 @@ -28,5 +29,28 @@ docker-push: docker-build podman push $(REGISTRY):$(VERSION) 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: rm -rf $(BUILD_DIR)