diff --git a/Makefile b/Makefile index b1aa40f9d868..4b61a9c453da 100644 --- a/Makefile +++ b/Makefile @@ -528,7 +528,7 @@ release: clean-release ## Builds and push container images using the latest git @if ! [ -z "$$(git status --porcelain)" ]; then echo "Your local git repository contains uncommitted changes, use git clean before proceeding."; exit 1; fi git checkout "${RELEASE_TAG}" # Build binaries first. - $(MAKE) release-binaries + GIT_VERSION=$(RELEASE_TAG) $(MAKE) release-binaries # Set the manifest image to the production bucket. $(MAKE) manifest-modification REGISTRY=$(PROD_REGISTRY) ## Build the manifests diff --git a/hack/version.sh b/hack/version.sh index 7450f45294c9..7f22394af69b 100755 --- a/hack/version.sh +++ b/hack/version.sh @@ -29,7 +29,7 @@ version::get_version_vars() { # stolen from k8s.io/hack/lib/version.sh # Use git describe to find the version based on annotated tags. - if GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then + if [[ -n ${GIT_VERSION-} ]] || GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then # This translates the "git describe" to an actual semver.org # compatible semantic version that looks something like this: # v1.1.0-alpha.0.6+84c76d1142ea4d