From 4c43d9e30f957c89a39f6c5dc0cc9ee584da2031 Mon Sep 17 00:00:00 2001 From: Yadong Ding Date: Mon, 6 Nov 2023 14:57:04 +0800 Subject: [PATCH] action: get latest tag by Github API Use https://api.github.com/repos/Dragonflyoss/nydus/releases/latest to get the latest tag of nydus, and used in smoke/integration-test. Signed-off-by: Yadong Ding --- .github/workflows/smoke.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 7522029f1d2..04e9360a349 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -16,8 +16,6 @@ env: CARGO_TERM_COLOR: always IMAGE: wordpress TAG: 6.1.1 - NYDUS_STABLE_VERSION: v2.2.3 - NYDUS_STABLE_VERSION_EXPORT: v2_2_3 jobs: contrib-build: @@ -151,8 +149,10 @@ jobs: - name: Prepare Older Binaries id: prepare-binaries run: | - versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}}) - version_archs=(v0.1.0-x86_64 ${{env.NYDUS_STABLE_VERSION}}-linux-amd64) + export NYDUS_STABLE_VERSION=$(curl https://api.github.com/repos/Dragonflyoss/nydus/releases/latest | jq -r '.tag_name') + + versions=(v0.1.0 ${NYDUS_STABLE_VERSION}) + version_archs=(v0.1.0-x86_64 ${NYDUS_STABLE_VERSION}-linux-amd64) for i in ${!versions[@]}; do version=${versions[$i]} version_arch=${version_archs[$i]} @@ -177,8 +177,11 @@ jobs: sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/bin/nydus-latest sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/bin/nydus-latest - versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}} latest) - version_exports=(v0_1_0 ${{env.NYDUS_STABLE_VERSION_EXPORT}} latest) + export NYDUS_STABLE_VERSION=$(curl https://api.github.com/repos/Dragonflyoss/nydus/releases/latest | jq -r '.tag_name') + export NYDUS_STABLE_VERSION_EXPORT="${NYDUS_STABLE_VERSION//./_}" + + versions=(v0.1.0 ${NYDUS_STABLE_VERSION} latest) + version_exports=(v0_1_0 ${NYDUS_STABLE_VERSION_EXPORT} latest) for i in ${!version_exports[@]}; do version=${versions[$i]} version_export=${version_exports[$i]}