Skip to content

Commit

Permalink
attempt to set up reproducible builds
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Linville <[email protected]>
  • Loading branch information
g-linville committed Apr 22, 2024
1 parent 5226b18 commit 3ef5b1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions hack/git-meta
Original file line number Diff line number Diff line change
Expand Up @@ -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 <version|revision>"
exit 1
Expand Down

0 comments on commit 3ef5b1a

Please sign in to comment.