tsk-1: Go version bump (#2)

Closes #1

Reviewed-on: #2
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-24 20:57:32 +00:00
committed by phoenix
parent ce7ccc8225
commit 2b14cdf7f6
6 changed files with 102 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
VERSION ?= $(shell git describe --tags 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD)
BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
GO_VERSION ?= $(shell go version | awk '{print $$3}')
.PHONY: build
build:
go build -ldflags="\
-X 'git.kundeng.us/phoenix/catapult/version.Version=$(VERSION)' \
-X 'git.kundeng.us/phoenix/catapult/version.BuildTime=$(BUILD_TIME)' \
-X 'git.kundeng.us/phoenix/catapult/version.Commit=$(COMMIT)' \
-X 'git.kundeng.us/phoenix/catapult/version.GoVersion=$(GO_VERSION)'" \
-o catapult main.go
.PHONY: install
install:
go install -ldflags="\
-X 'git.kundeng.us/phoenix/catapult/version.Version=$(VERSION)' \
-X 'git.kundeng.us/phoenix/catapult/version.BuildTime=$(BUILD_TIME)' \
-X 'git.kundeng.us/phoenix/catapult/version.Commit=$(COMMIT)' \
-X 'git.kundeng.us/phoenix/catapult/version.GoVersion=$(GO_VERSION)'"