From d57155a19beeb60a495b3b79a42a4ae1a25862e6 Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Wed, 2 Jul 2025 13:43:59 -0500 Subject: [PATCH] CI: Support large build IDs in artifact builds (#107533) * CI: Support large build IDs in artifact builds * Use run_id instead of run_number in prerelease builds --- .github/actions/build-package/action.yml | 2 +- .github/workflows/release-build.yml | 6 +++--- pkg/build/daggerbuild/msi/wxs.go | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-package/action.yml b/.github/actions/build-package/action.yml index 5b9275c95fe..123484071e7 100644 --- a/.github/actions/build-package/action.yml +++ b/.github/actions/build-package/action.yml @@ -30,7 +30,7 @@ inputs: build-id: type: string description: an identifier number which can be traced back to the workflow run. - default: ${{github.run_number}} + default: ${{github.run_id}} required: false patches-repo: type: string diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 2ee344e8ebd..54c81f1091f 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -59,7 +59,7 @@ jobs: run: jq -r .version package.json | sed -s "s/pre/${BUILD_ID}/g" > VERSION env: REF_NAME: ${{ github.ref_name }} - BUILD_ID: ${{ github.run_number }} + BUILD_ID: ${{ github.run_id }} - id: output run: | echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" @@ -90,7 +90,7 @@ jobs: env: REF: ${{ github.ref_name }} VERSION: ${{ needs.setup.outputs.version }} - BUILD_ID: ${{ github.run_number }} + BUILD_ID: ${{ github.run_id }} BUCKET: grafana-prerelease GRAFANA_COMMIT: ${{ needs.setup.outputs.grafana-commit }} with: @@ -163,7 +163,7 @@ jobs: version: ${{ needs.setup.outputs.version }} output: artifacts-${{ matrix.name }}.txt verify: true - build-id: ${{ github.run_number }} + build-id: ${{ github.run_id }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: artifacts-list-${{ matrix.name }} diff --git a/pkg/build/daggerbuild/msi/wxs.go b/pkg/build/daggerbuild/msi/wxs.go index bad26bb5a37..443545de56a 100644 --- a/pkg/build/daggerbuild/msi/wxs.go +++ b/pkg/build/daggerbuild/msi/wxs.go @@ -50,6 +50,9 @@ func WxsVersion(ersion string) string { v = "0" } + if len(v) > 5 { + v = v[len(v)-5:] + } return fmt.Sprintf("%s.%s.%s.%s", major, minor, patch, v) } return fmt.Sprintf("%s.%s.%s.0", major, minor, patch)