ci: release automation from Conventional Commits
tools/release derives the next version from the commits since the last stable release and renders the changelog. `make release` tags it on main, CHANNEL=beta a numbered prerelease of the coming version; pushing the tag runs the release workflow, which publishes the release with its notes, Linux binaries and checksums. Images get channel tags: edge for main, beta for prereleases, latest, stable and X.Y for releases. Closes #33 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
1ad68e2e87
commit
68a7827475
8 files changed
+644
-5
No files matched your search
@@ -3,7 +3,7 @@ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
|
||||
PKG := git.zb-server.de/ZB-Server/uptimesebi
|
||||
LDFLAGS := -s -w -X $(PKG)/internal/buildinfo.Version=$(VERSION) -X $(PKG)/internal/buildinfo.Commit=$(COMMIT)
|
||||
|
||||
.PHONY: generate web build test lint dev-up dev-up-sentinel dev-down migrate image
|
||||
.PHONY: generate web build test lint release dev-up dev-up-sentinel dev-down migrate image
|
||||
|
||||
generate:
|
||||
sqlc generate
|
||||
@@ -22,6 +22,19 @@ test:
|
||||
lint:
|
||||
golangci-lint run
|
||||
|
||||
# Tags the next release from the Conventional Commits since the last one;
|
||||
# pushing the tag publishes it. CHANNEL=beta tags a prerelease.
|
||||
CHANNEL ?= stable
|
||||
release:
|
||||
@test "$$(git rev-parse --abbrev-ref HEAD)" = main || { echo "release from main" >&2; exit 1; }
|
||||
@git diff --quiet HEAD || { echo "commit or stash your changes first" >&2; exit 1; }
|
||||
@git fetch -q --tags origin main
|
||||
@test "$$(git rev-parse HEAD)" = "$$(git rev-parse origin/main)" || { echo "main is not origin/main" >&2; exit 1; }
|
||||
@tag="$$(go run ./tools/release next $(CHANNEL))" && \
|
||||
git tag -a "$$tag" -m "$$tag" && \
|
||||
go run ./tools/release notes "$$tag" && \
|
||||
echo "Tagged $$tag. Publish it with: git push origin $$tag"
|
||||
|
||||
dev-up:
|
||||
docker compose up -d --wait
|
||||
|
||||
|
||||
Reference in new issue
Block a user