-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (38 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
46 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: build clean install test lint tidy release
BINARY := agent-proxy
BUILD_DIR := bin
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
build:
go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY) ./cmd/agent-proxy
clean:
rm -rf $(BUILD_DIR)
install: build
cp $(BUILD_DIR)/$(BINARY) /usr/local/bin/
test:
go test ./...
lint:
golangci-lint run ./...
tidy:
go mod tidy
# Usage: make release VERSION=v0.8.0
# Generates CHANGELOG.md from conventional commits, commits it,
# creates an annotated tag, and pushes everything to trigger GoReleaser.
release:
ifndef VERSION
$(error VERSION is required. Usage: make release VERSION=v0.8.0)
endif
@command -v git-cliff >/dev/null 2>&1 || { echo "git-cliff not installed: brew install git-cliff"; exit 1; }
@echo "→ Generating CHANGELOG.md..."
git-cliff --config cliff.toml --tag $(VERSION) -o CHANGELOG.md
@echo "→ Committing CHANGELOG..."
git add CHANGELOG.md
git commit -m "docs: CHANGELOG for $(VERSION)" --allow-empty
@echo "→ Tagging $(VERSION)..."
git tag -a $(VERSION) -m "$(VERSION)"
@echo "→ Pushing to origin..."
git push --no-verify origin main
git push --no-verify origin $(VERSION)
@echo ""
@echo "✓ Released $(VERSION) — GoReleaser workflow triggered."
@echo " Monitor: gh run list --repo chiga0/agent-proxy --limit 1"