From 9fabd950e5a3ddd46f2ed6205f70c3e3d18d21b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 15:51:17 +0800 Subject: [PATCH] Chore: avoid update version file when publish smaller version (#4287) Signed-off-by: qiaozp (cherry picked from commit 696234e1aa94843ffa366bc581cdf5e2080cc6d5) Co-authored-by: qiaozp --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c7ebee5e..827a3ede8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,6 +123,11 @@ jobs: - name: sync the latest version file if: ${{ !contains(env.VELA_VERSION,'alpha') && !contains(env.VELA_VERSION,'beta') }} run: | + LATEST_VERSION=$(curl -fsSl https://static.kubevela.net/binary/vela/latest_version) + verlte() { + [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] + } + verlte ${{ env.VELA_VERSION }} $LATEST_VERSION && echo "${{ env.VELA_VERSION }} <= $LATEST_VERSION, skip update" && exit 0 echo ${{ env.VELA_VERSION }} > ./latest_version ./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version