Skip to content

Commit 81f9a48

Browse files
chore: update Makefile and hack/release.sh to accept TAG (#798)
The upstream release pipeline does not tag the source until the build and tests have successfully completed. This should allow for our release builds to pick up the knative infra TAG environment variable when building releases. Signed-off-by: Lance Ball <[email protected]> Co-authored-by: Lance Ball <[email protected]>
1 parent 947f982 commit 81f9a48

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ BIN_WINDOWS ?= $(BIN)_windows_amd64.exe
1313
# Version
1414
# A verbose version is built into the binary including a date stamp, git commit
1515
# hash and the version tag of the current commit (semver) if it exists.
16-
# If the current commit does not have a semver tag, 'tip' is used.
16+
# If the current commit does not have a semver tag, 'tip' is used, unless there
17+
# is a TAG environment variable. Precedence is git tag, environment variable, 'tip'
1718
DATE := $(shell date -u +"%Y%m%dT%H%M%SZ")
1819
HASH := $(shell git rev-parse --short HEAD 2>/dev/null)
1920
VTAG := $(shell git tag --points-at HEAD)
21+
VTAG := $(shell [ -z $(VTAG) ] && echo $(TAG) || echo $(VTAG))
2022
VERS ?= $(shell [ -z $(VTAG) ] && echo 'tip' || echo $(VTAG) )
2123
LDFLAGS := "-X main.date=$(DATE) -X main.vers=$(VERS) -X main.hash=$(HASH)"
2224

Diff for: hack/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source $(dirname $0)/../vendor/knative.dev/hack/release.sh
2323

2424
function build_release() {
2525
echo "🚧 🐧 Building cross platform binaries: Linux 🐧 (amd64), MacOS 🍏, and Windows 🎠"
26-
make cross-platform
26+
TAG=${TAG} make cross-platform
2727

2828
ARTIFACTS_TO_PUBLISH="func_darwin_amd64 func_linux_amd64 func_windows_amd64.exe"
2929
sha256sum ${ARTIFACTS_TO_PUBLISH} > checksums.txt

0 commit comments

Comments
 (0)