flake.nix reads from VERSION instead of hardcoding; Makefile gains a version target that syncs VERSION from the latest git tag and injects it into go build ldflags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
464 B
Makefile
26 lines
464 B
Makefile
VERSION := $(shell git describe --tags --abbrev=0 | sed 's/^v//')
|
|
|
|
.PHONY: proto build test lint clean version
|
|
|
|
proto:
|
|
protoc \
|
|
--go_out=. --go_opt=module=github.com/kisom/sgard \
|
|
--go-grpc_out=. --go-grpc_opt=module=github.com/kisom/sgard \
|
|
-I proto \
|
|
proto/sgard/v1/sgard.proto
|
|
|
|
version:
|
|
@echo $(VERSION) > VERSION
|
|
|
|
build:
|
|
go build -ldflags "-X main.version=$(VERSION)" ./...
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
clean:
|
|
rm -f sgard
|