From f34eaa2fad01f2eb431baae412efcf16a51f0605 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 21 Feb 2024 16:57:31 +0900 Subject: [PATCH 1/3] fix: release branch name Signed-off-by: hlts2 --- .github/actions/determine-docker-image-tag/action.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/determine-docker-image-tag/action.yaml b/.github/actions/determine-docker-image-tag/action.yaml index 1f4b449861..94644e7d22 100644 --- a/.github/actions/determine-docker-image-tag/action.yaml +++ b/.github/actions/determine-docker-image-tag/action.yaml @@ -50,11 +50,10 @@ runs: primary_tag="pr-${pr_num}" default_tag="nightly" - # For pull request to the release branch, use the release branch latest tag as the default tag (vx.x). + # For pull request to the release branch, use the release branch latest tag as the default tag (release/vx.x). # This is only set if the event that triggers the workflow execution is pull_request or pull_request_target. if [[ "$GITHUB_BASE_REF" =~ ^release/v([0-9]+)\.([0-9]+)$ ]]; then - tag_name=`echo $GITHUB_BASE_REF | sed -e 's:^release/::'` - default_tag="${tag_name}" + default_tag="$(echo "$GITHUB_BASE_REF")" fi elif [ "$GITHUB_REF" = "refs/heads/main" ]; then echo "nightly" > versions/VALD_VERSION @@ -62,7 +61,7 @@ runs: primary_tag="nightly" default_tag="nightly" elif [[ "$GITHUB_REF" =~ ^refs/heads/release/v([0-9]+)\.([0-9]+)$ ]]; then - tag_name=`echo $GITHUB_REF | sed -e 's:^refs/heads/release/::'` + tag_name="$(echo "$GITHUB_REF")" echo "${tag_name}" > versions/VALD_VERSION primary_tag="${tag_name}" From 6b633320f578048c9cdd6d9c923eac45dfe47b26 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 21 Feb 2024 17:03:15 +0900 Subject: [PATCH 2/3] fix: release branch build image name Signed-off-by: hlts2 --- .github/actions/determine-docker-image-tag/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/determine-docker-image-tag/action.yaml b/.github/actions/determine-docker-image-tag/action.yaml index 94644e7d22..ebd44709e9 100644 --- a/.github/actions/determine-docker-image-tag/action.yaml +++ b/.github/actions/determine-docker-image-tag/action.yaml @@ -61,7 +61,7 @@ runs: primary_tag="nightly" default_tag="nightly" elif [[ "$GITHUB_REF" =~ ^refs/heads/release/v([0-9]+)\.([0-9]+)$ ]]; then - tag_name="$(echo "$GITHUB_REF")" + tag_name=`echo $GITHUB_REF | sed -e 's:^refs/heads/::'` echo "${tag_name}" > versions/VALD_VERSION primary_tag="${tag_name}" From d6feb24601d9f45e38c38e0470fc9ca2d125f139 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 21 Feb 2024 17:14:43 +0900 Subject: [PATCH 3/3] fix: major minor tag build Signed-off-by: hlts2 --- .github/actions/docker-build/action.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 34e1a416ba..62d440cbd7 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -92,6 +92,10 @@ runs: if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then latest_tags="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest" extra_tags="${extra_tags} ${latest_tags}" + + major_minor_tag=$(echo "$GITHUB_REF" | sed -E 's/^refs\/tags\/v?([0-9]+\.[0-9]+).*$/v\1/') + major_minor_tags="-t ${IMAGE_NAME}:${major_minor_tag} -t ${ALTER_IMAGE_NAME}:${major_minor_tag}" + extra_tags="${extra_tags} ${major_minor_tags}" fi if [[ "$GITHUB_REF" =~ ^refs/heads/main$ ]] || [[ "$GITHUB_REF" =~ ^refs/heads/master$ ]] || [[ "$GITHUB_REF" =~ ^refs/heads/release.* ]] || [[ "${PRIMARY_TAG}" == "nightly" ]]; then commit_hash=${GITHUB_SHA::8}