From 6256cdc97a7dd0af1fced712498440175f3be1e9 Mon Sep 17 00:00:00 2001 From: freeze <1615081+Vicente-Cheng@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:33:24 +0800 Subject: [PATCH] ci: pin package version to the git tag for tag builds (#1165) Sprint tags (vX.Y.Z-dev-YYYYMMDD) only share a prefix with the x.y.z-dev version in package.json, so every sprint plugin reported the same version and the catalog image push hit "Cannot overwrite production image". Bump the tree to the tag before building. Related issue: harvester/harvester#11047 Signed-off-by: Vicente Cheng --- .github/workflows/build-and-publish-standalone.yaml | 7 +++++++ .github/workflows/build-extension-catalog.yml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/build-and-publish-standalone.yaml b/.github/workflows/build-and-publish-standalone.yaml index c4bd5e9e..3f1a0470 100644 --- a/.github/workflows/build-and-publish-standalone.yaml +++ b/.github/workflows/build-and-publish-standalone.yaml @@ -125,6 +125,13 @@ jobs: node-version-file: '.nvmrc' cache: 'yarn' + # Tag builds (RC, formal and sprint releases) ship the tag as the package + # version. RC/formal tags already match package.json; sprint tags + # (vX.Y.Z-dev-YYYYMMDD) only share its prefix, so pin it here for the build. + - name: Pin package version to tag + if: ${{ inputs.CI_BUILD_TAG != '' }} + run: ./scripts/bump_version.sh "${{ inputs.CI_BUILD_TAG }}" + - id: ci-build-pkg name: Build pkg run: ./scripts/ci-build-pkg.sh harvester diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml index d0ba5cb8..07754806 100644 --- a/.github/workflows/build-extension-catalog.yml +++ b/.github/workflows/build-extension-catalog.yml @@ -58,6 +58,12 @@ jobs: - name: Setup Nodejs with yarn install uses: ./.github/actions/setup + # The catalog image is tagged with the package.json version. Sprint tags + # (vX.Y.Z-dev-YYYYMMDD) only share its prefix, so pin it to the tag here. + - name: Pin package version to tag + if: ${{ github.ref_type == 'tag' }} + run: ./scripts/bump_version.sh "${{ github.ref_name }}" + - name: Build and push UI image run: | publish="yarn publish-pkgs -cp -r ${{ inputs.registry_target }} -o ${{ inputs.registry_user }}"