From 757f9589436eb7ecaf70a392ee6bf6207dca0d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 27 Feb 2024 14:22:54 +0100 Subject: [PATCH] release: Adjust tags used to publish our deamonset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to adjust the tags as when this workflow ends up being called from the release side, we'll receive "refs/tags/main" as the GITHUB_REF, and in that case we must use the release version. Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/release-amd64.yaml | 8 ++++++-- .github/workflows/release-arm64.yaml | 8 ++++++-- .github/workflows/release-ppc64le.yaml | 8 ++++++-- .github/workflows/release-s390x.yaml | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-amd64.yaml b/.github/workflows/release-amd64.yaml index c197da0b56..97ae890e0d 100644 --- a/.github/workflows/release-amd64.yaml +++ b/.github/workflows/release-amd64.yaml @@ -41,8 +41,12 @@ jobs: # We need to do such trick here as the format of the $GITHUB_REF # is "refs/tags/" tag=$(echo $GITHUB_REF | cut -d/ -f3-) - tags=($tag) - tags+=($([[ "$tag" =~ "alpha"|"rc" ]] && echo "latest" || echo "stable")) + if [ "${tag}" = "main" ]; then + tag=$(./tools/packaging/release/release.sh next-release-version) + tags=(${tag} "latest") + else + tags=(${tag}) + fi for tag in ${tags[@]}; do ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \ $(pwd)/kata-static.tar.xz "docker.io/katadocker/kata-deploy" \ diff --git a/.github/workflows/release-arm64.yaml b/.github/workflows/release-arm64.yaml index fd2c9065ee..c6d663407f 100644 --- a/.github/workflows/release-arm64.yaml +++ b/.github/workflows/release-arm64.yaml @@ -41,8 +41,12 @@ jobs: # We need to do such trick here as the format of the $GITHUB_REF # is "refs/tags/" tag=$(echo $GITHUB_REF | cut -d/ -f3-) - tags=($tag) - tags+=($([[ "$tag" =~ "alpha"|"rc" ]] && echo "latest" || echo "stable")) + if [ "${tag}" = "main" ]; then + tag=$(./tools/packaging/release/release.sh next-release-version) + tags=(${tag} "latest") + else + tags=(${tag}) + fi for tag in ${tags[@]}; do ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \ $(pwd)/kata-static.tar.xz "docker.io/katadocker/kata-deploy" \ diff --git a/.github/workflows/release-ppc64le.yaml b/.github/workflows/release-ppc64le.yaml index bcdbb39deb..68e7ac19ce 100644 --- a/.github/workflows/release-ppc64le.yaml +++ b/.github/workflows/release-ppc64le.yaml @@ -41,8 +41,12 @@ jobs: # We need to do such trick here as the format of the $GITHUB_REF # is "refs/tags/" tag=$(echo $GITHUB_REF | cut -d/ -f3-) - tags=($tag) - tags+=($([[ "$tag" =~ "alpha"|"rc" ]] && echo "latest" || echo "stable")) + if [ "${tag}" = "main" ]; then + tag=$(./tools/packaging/release/release.sh next-release-version) + tags=(${tag} "latest") + else + tags=(${tag}) + fi for tag in ${tags[@]}; do ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \ $(pwd)/kata-static.tar.xz "docker.io/katadocker/kata-deploy" \ diff --git a/.github/workflows/release-s390x.yaml b/.github/workflows/release-s390x.yaml index e81ae2392c..be3a46fc59 100644 --- a/.github/workflows/release-s390x.yaml +++ b/.github/workflows/release-s390x.yaml @@ -42,8 +42,12 @@ jobs: # We need to do such trick here as the format of the $GITHUB_REF # is "refs/tags/" tag=$(echo $GITHUB_REF | cut -d/ -f3-) - tags=($tag) - tags+=($([[ "$tag" =~ "alpha"|"rc" ]] && echo "latest" || echo "stable")) + if [ "${tag}" = "main" ]; then + tag=$(./tools/packaging/release/release.sh next-release-version) + tags=(${tag} "latest") + else + tags=(${tag}) + fi for tag in ${tags[@]}; do ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \ $(pwd)/kata-static.tar.xz "docker.io/katadocker/kata-deploy" \