chore(ci): add GitHub Actions workflow for release process
Some checks failed
Release / test (push) Successful in -30m15s
Release / release (push) Failing after -29m26s

* Implement test and release jobs for versioned tags
* Build binaries for multiple OS/architecture targets
* Create release and upload assets to GitHub
* Add release-version target in Makefile for version bumping
This commit is contained in:
Hein
2026-04-08 11:29:50 +02:00
parent a8c12c8c21
commit 125b73289a
3 changed files with 86 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ CONFIG_DIR := /etc/unitdore
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
.PHONY: all build install uninstall test lint clean
.PHONY: all build install uninstall test lint clean release-version
all: build
@@ -40,6 +40,18 @@ lint:
clean:
rm -f $(BINARY)
## release-version: bump patch version, tag, and push to trigger release workflow
release-version:
@CURRENT=$$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"); \
MAJOR=$$(echo $$CURRENT | sed 's/v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'); \
MINOR=$$(echo $$CURRENT | sed 's/v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'); \
PATCH=$$(echo $$CURRENT | sed 's/v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'); \
NEXT="v$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
echo "Current: $$CURRENT → Next: $$NEXT"; \
git tag -a "$$NEXT" -m "Release $$NEXT"; \
git push origin "$$NEXT"; \
echo "Pushed tag $$NEXT — release workflow triggered"
## help: show this help
help:
@grep -E '^## ' Makefile | sed 's/## / /'