add metadata prefooter

This commit is contained in:
Gitea
2023-11-22 01:12:04 +03:00
parent 9bc56666a0
commit f382d9e73b
5 changed files with 209 additions and 106 deletions

View File

@ -4,6 +4,15 @@ env:
CGO_ENABLED: 0
GOBIN: "{{.USER_WORKING_DIR}}/bin"
PROJECT: "git.loyso.art/frx/kurious"
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
GIT_VERSION:
sh: git tag | sort -r --version-sort | head -n1
BUILD_TIME:
sh: TZ=UTC date --iso-8601=seconds
LDFLAGS:
sh: echo '-X "{{.PROJECT}}.buildTime={{.BUILD_TIME}}" -X "{{.PROJECT}}.commit={{.GIT_COMMIT}}" -X "{{.PROJECT}}.version={{.GIT_VERSION}}"'
tasks:
install_tools:
@ -17,4 +26,9 @@ tasks:
- go test --count=1 ./internal/...
build:
cmds:
- go build -o $GOBIN/sravnicli -v -ldflags "-X '$PROJECT.version=ohwell'" cmd/dev/sravnicli/main.go
- go build -o $GOBIN/sravnicli -v -ldflags '{{.LDFLAGS}}' cmd/dev/sravnicli/main.go
deps: [check, test]
run:
deps: [build]
cmds:
- $GOBIN/sravnicli