From 3a8d646264ba45b921bb950a4aebda0dc190aa7a Mon Sep 17 00:00:00 2001 From: David Simansky Date: Thu, 23 Mar 2023 17:35:55 +0100 Subject: [PATCH] fix: Fix image tag for nightly builds (#1796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Fix image tag for nightly builds * Update hack/release.sh Co-authored-by: Roland Huß --------- Co-authored-by: Roland Huß --- hack/release.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hack/release.sh b/hack/release.sh index f17de13ce..ff7be9aac 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -47,16 +47,18 @@ function build_release() { # # Tagging of images by the $TAG variable is done in `tag_images_in_yamls()` of hack/release.sh. # - if [ "$(patch_version "${TAG}")" == 0 ]; then - echo "Newest .0 release - publish latest image tag" - else - local latest_minor=$(minor_version "$(latest_version)") - local current_minor=$(minor_version "${TAG}") - if ((current_minor >= latest_minor)); then - echo "Newer patch release - publish latest image tag" + if is_release_branch; then + if [ "$(patch_version "${TAG}")" == 0 ]; then + echo "Newest .0 release - publish latest image tag" else - echo "Patch release of older minor version - do not publish lates image tag" - KO_FLAGS=$KO_FLAGS" --tags \"\"" + local latest_minor=$(minor_version "$(latest_version)") + local current_minor=$(minor_version "${TAG}") + if ((current_minor >= latest_minor)); then + echo "Newer patch release - publish latest image tag" + else + echo "Patch release of older minor version - do not publish latest image tag" + KO_FLAGS=$KO_FLAGS" --tags \"\"" + fi fi fi echo "KO_FLAGS:${KO_FLAGS}"