feat: include git commit & build date information in builds

This commit is contained in:
2025-06-23 04:30:23 -05:00
parent 133c95cd36
commit 8a96cb07d4
3 changed files with 8 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ vars:
tasks:
build:
cmds:
- go build -o ./bin/{{.BINARY_NAME}} ./cmd/main.go
- go build -ldflags "-X main.Version=$(cat VERSION.txt) -X main.Commit=$(git rev-parse --short HEAD) -X 'main.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)'" -o ./bin/{{.BINARY_NAME}} ./cmd/main.go
service:
desc: "Install the service"

View File

@@ -6,7 +6,7 @@ vars:
tasks:
build:
cmds:
- go build -ldflags "-X main.Version=$(Get-Content VERSION.txt)" -o ./bin/{{.BINARY_NAME}} ./cmd/main.go
- go build -ldflags "-X main.Version=$(Get-Content VERSION.txt) -X main.Commit=$(git rev-parse --short HEAD) -X 'main.BuildDate=$(Get-Date -Format yyyy-MM-ddTHH:mm:ssZ)'" -o ./bin/{{.BINARY_NAME}} ./cmd/main.go
service:
desc: "Install the service"