From d6e2bf090b1f221b46b274ed7d1f0f2cf0d1ea4c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 22 Nov 2018 09:50:07 -0800 Subject: [PATCH] hack/release: Tag before building This gets the correct main.version value. Before this commit, you could have: $ hack/release.sh v0.4.0 ... + go build -ldflags ' -X main.version=v0.3.0-273-g...' ... ... With this commit, that same invocation will give you: + go build -ldflags ' -X main.version=v0.4.0' ... The bug is from the initial script in 7b023303 (hack/release: Make it easy to cross-compile release binaries, 2018-10-02, #397). --- hack/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/release.sh b/hack/release.sh index f10f634e4f..fe2bda1b51 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -10,6 +10,7 @@ cd "$(dirname "$0")" TAG="${1}" +git tag -sm "version ${TAG}" "${TAG}" ./build.sh # ensure freshly-generated data for GOOS in darwin linux do @@ -18,4 +19,3 @@ do GOOS="${GOOS}" GOARCH="${GOARCH}" OUTPUT="${OUTPUT}" SKIP_GENERATION=y ./build.sh done (cd ../bin && sha256sum openshift-install-*) -git tag -sm "version ${TAG}" "${TAG}"