From d5baaa67b8d0123ca53fd5130a0763e2088b2c8b Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Thu, 16 Jul 2026 17:39:56 +0800 Subject: [PATCH] ci: restore latest.json updates for prerelease tags (#4903) PR #4582 gated the update-latest-version job to stable release tags so prereleases could not overwrite the stable version pointer. But the project currently ships prerelease tags only (beta previews), so the job never runs and latest.json has been stale since. Run the job for every release tag again, and keep the honest half of the #4582 fix by writing release_type from the actual build type instead of hardcoding "stable". --- .github/workflows/build.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57dda24bb..c5e9ce12c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -848,12 +848,14 @@ jobs: echo "✅ All assets uploaded successfully" - # Update latest.json for stable releases only: prerelease tags (alpha/beta/ - # rc) must never overwrite the stable version pointer. + # Update latest.json for every release tag (stable and prerelease): the + # project currently ships prerelease tags only, so gating this to stable + # left the version pointer permanently stale. release_type records whether + # the pointed-to version is a prerelease. update-latest-version: name: Update Latest Version needs: [ build-check, upload-release-assets ] - if: startsWith(github.ref, 'refs/tags/') && needs.build-check.outputs.build_type == 'release' + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - name: Update latest.json @@ -872,6 +874,12 @@ jobs: VERSION="${{ needs.build-check.outputs.version }}" TAG="${{ needs.build-check.outputs.version }}" + if [[ "${{ needs.build-check.outputs.build_type }}" == "prerelease" ]]; then + RELEASE_TYPE="prerelease" + else + RELEASE_TYPE="stable" + fi + # Install ossutil OSSUTIL_VERSION="2.1.1" OSSUTIL_ZIP="ossutil-${OSSUTIL_VERSION}-linux-amd64.zip" @@ -892,7 +900,7 @@ jobs: "version": "${VERSION}", "tag": "${TAG}", "release_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", - "release_type": "stable", + "release_type": "${RELEASE_TYPE}", "download_url": "https://github.com/${{ github.repository }}/releases/tag/${TAG}" } EOF @@ -900,7 +908,7 @@ jobs: # Upload to OSS "$OSSUTIL_BIN" cp latest.json oss://rustfs-version/latest.json --force - echo "✅ Updated latest.json for stable release $VERSION" + echo "✅ Updated latest.json for ${RELEASE_TYPE} release $VERSION" # Publish release (remove draft status) publish-release: