Skip to content

Commit 07ab86c

Browse files
committed
release process
Signed-off-by: Sean Porter <portertech@gmail.com>
1 parent 76ddb37 commit 07ab86c

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build build-all test lint fmt fmt-check vet clean install docker docker-release docker-buildx-setup docker-login docker-push docker-publish
1+
.PHONY: build build-all test lint fmt fmt-check vet clean install docker docker-release docker-buildx-setup docker-login docker-push docker-publish version tag-version release ci
22

33
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
44
LDFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
@@ -83,3 +83,20 @@ docker-publish: docker-push
8383

8484
# Run all checks (used in CI)
8585
ci: lint test
86+
87+
# List version
88+
version:
89+
@echo $(VERSION)
90+
91+
# Create annotated git tag (requires VERSION to be set explicitly)
92+
tag-version:
93+
@if [ "$(VERSION)" = "dev" ] || echo "$(VERSION)" | grep -q dirty; then \
94+
echo "Error: VERSION must be set explicitly and not be 'dev' or dirty"; \
95+
echo "Usage: make tag-version VERSION=1.0.0"; \
96+
exit 1; \
97+
fi
98+
git tag -a "v$(VERSION)" -m "v$(VERSION)"
99+
100+
# Full release: ci -> tag-version -> docker-publish
101+
# Usage: make release VERSION=1.0.0
102+
release: ci tag-version docker-publish

0 commit comments

Comments
 (0)