From 7af471c5aa39caf30f5a3f378e9712da03c8e2ff Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 20 Aug 2025 01:49:07 +0800 Subject: [PATCH] ci: add `is-current-version-latest` check to `helm-charts/homebrew-greptime` bump jobs (#6772) ci: add check to helm/homebrew bump jobs Signed-off-by: liyang --- .github/scripts/check-version.sh | 4 ++-- .github/workflows/release.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/scripts/check-version.sh b/.github/scripts/check-version.sh index 6ea4d154be..28c2812ded 100755 --- a/.github/scripts/check-version.sh +++ b/.github/scripts/check-version.sh @@ -35,8 +35,8 @@ HIGHER_VERSION=$(printf "%s\n%s" "$CLEAN_CURRENT" "$CLEAN_LATEST" | sort -V | ta if [ "$HIGHER_VERSION" = "$CLEAN_CURRENT" ]; then echo "Current version ($CLEAN_CURRENT) is NEWER than or EQUAL to latest ($CLEAN_LATEST)" - echo "should-push-latest-tag=true" >> $GITHUB_OUTPUT + echo "is-current-version-latest=true" >> $GITHUB_OUTPUT else echo "Current version ($CLEAN_CURRENT) is OLDER than latest ($CLEAN_LATEST)" - echo "should-push-latest-tag=false" >> $GITHUB_OUTPUT + echo "is-current-version-latest=false" >> $GITHUB_OUTPUT fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a42b82773..bc9da93b9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,8 @@ jobs: # The 'version' use as the global tag name of the release workflow. version: ${{ steps.create-version.outputs.version }} - should-push-latest-tag: ${{ steps.check-version.outputs.should-push-latest-tag }} + # The 'is-current-version-latest' determines whether to update 'latest' Docker tags and downstream repositories. + is-current-version-latest: ${{ steps.check-version.outputs.is-current-version-latest }} steps: - name: Checkout uses: actions/checkout@v4 @@ -321,7 +322,7 @@ jobs: image-registry-username: ${{ secrets.DOCKERHUB_USERNAME }} image-registry-password: ${{ secrets.DOCKERHUB_TOKEN }} version: ${{ needs.allocate-runners.outputs.version }} - push-latest-tag: ${{ needs.allocate-runners.outputs.should-push-latest-tag == 'true' && github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} + push-latest-tag: ${{ needs.allocate-runners.outputs.is-current-version-latest == 'true' && github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} - name: Set build image result id: set-build-image-result @@ -368,7 +369,7 @@ jobs: dev-mode: false upload-to-s3: true update-version-info: true - push-latest-tag: ${{ needs.allocate-runners.outputs.should-push-latest-tag == 'true' && github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} + push-latest-tag: ${{ needs.allocate-runners.outputs.is-current-version-latest == 'true' && github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} publish-github-release: name: Create GitHub release and upload artifacts @@ -476,7 +477,7 @@ jobs: bump-helm-charts-version: name: Bump helm charts version - if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} + if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' && needs.allocate-runners.outputs.is-current-version-latest == 'true' }} needs: [allocate-runners, publish-github-release] runs-on: ubuntu-latest permissions: @@ -497,7 +498,7 @@ jobs: bump-homebrew-greptime-version: name: Bump homebrew greptime version - if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' }} + if: ${{ github.ref_type == 'tag' && !contains(github.ref_name, 'nightly') && github.event_name != 'schedule' && needs.allocate-runners.outputs.is-current-version-latest == 'true' }} needs: [allocate-runners, publish-github-release] runs-on: ubuntu-latest permissions: