diff --git a/Makefile b/Makefile index 8aecf0de..430d7c2a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ PACKAGE ?= github.com/gptscript-ai/gptscript-credential-helpers VERSION ?= $(shell ./hack/git-meta version) REVISION ?= $(shell ./hack/git-meta revision) +COMMIT_DATE ?= $(shell .hack/git-meta commit-date) GO_PKG = github.com/gptscript-ai/gptscript-credential-helpers -GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/credentials.Revision=${REVISION} -X ${GO_PKG}/credentials.Package=${PACKAGE} +GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/credentials.Revision=${REVISION} -X ${GO_PKG}/credentials.Package=${PACKAGE} -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${COMMIT_DATE} BUILDX_CMD ?= docker buildx DESTDIR ?= ./bin/build diff --git a/hack/git-meta b/hack/git-meta index ed4bfb84..65e4cbc6 100755 --- a/hack/git-meta +++ b/hack/git-meta @@ -9,6 +9,9 @@ case $1 in "revision") echo "$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)" ;; + "commit-date") + git show -s --format=%cI HEAD + ;; *) echo "usage: ./hack/git-meta " exit 1