feat: add GitCommit/GitBranch/BuildTime in version info

This commit is contained in:
lilong.129
2025-03-17 20:40:03 +08:00
parent fb3f8a6fca
commit d63e5e0c1a
6 changed files with 40 additions and 39 deletions

View File

@@ -1,23 +0,0 @@
#!/bin/bash
# build hrp cli binary for testing
# release will be triggered on github actions, see .github/workflows/release.yml
# Usage:
# $ make build
# or
# $ bash scripts/build.sh
set -e
set -x
# prepare path
mkdir -p "output"
bin_path="output/hrp"
# build
go build -ldflags '-s -w' -o "$bin_path" cmd/cli/main.go
# check output and version
ls -lh "$bin_path"
chmod +x "$bin_path"
./"$bin_path" -v