feat: add server version

This commit is contained in:
hiifong
2025-03-16 15:22:57 +08:00
parent c900e6b4c3
commit 82b02fa9f1
5 changed files with 42 additions and 6 deletions

View File

@@ -1,9 +1,11 @@
GO ?= go
EXECUTABLE := gitea-mcp
VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
LDFLAGS := -X "main.Version=$(VERSION)"
.PHONY: build
build:
$(GO) build -v -ldflags '-s -w' -o $(EXECUTABLE)
$(GO) build -v -ldflags '-s -w $(LDFLAGS)' -o $(EXECUTABLE)
## air: install air for hot reload
.PHONY: air