From f20d5fd49eef0d274116ecf95d21d92a628193f7 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Thu, 3 Sep 2026 18:51:34 -0400 Subject: [PATCH 1/2] fix(release): hand the Windows channels final asset names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The snapshot build names archives with the snapshot version, so the Chocolatey and WinGet matrices were told to fetch gro_v1.2.1-SNAPSHOT-… from a release that only has gro_v1.2.1_…. Rewrite the snapshot version to the final one before enriching the matrices. --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 037bd6e..ef591c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -189,15 +189,23 @@ jobs: env: CHOCOLATEY: ${{ steps.meta.outputs.chocolatey-base-matrix }} WINGET: ${{ steps.meta.outputs.winget-base-matrix }} + VERSION: ${{ steps.meta.outputs.version }} run: | set -euo pipefail + # The snapshot build names its archives with the snapshot version + # (e.g. 1.2.1-SNAPSHOT-abc1234); the published release uses the final + # version, so rewrite that substring before handing names to the + # Windows channels. + snapshot_version="$(jq -r '.version' dist/metadata.json)" + [ -n "$snapshot_version" ] && [ "$snapshot_version" != null ] || { echo "::error::dist/metadata.json has no version"; exit 1; } enrich() { - printf '%s' "$1" | jq -c --slurpfile artifacts dist/artifacts.json ' + printf '%s' "$1" | jq -c --slurpfile artifacts dist/artifacts.json --arg snap "$snapshot_version" --arg final "$VERSION" ' def owns($name): (.extra.ID // "") == $name or ((.extra.Binaries // []) | index($name) != null); + def finalize: split($snap) | join($final); def asset($name; $arch): - [$artifacts[0][] | select(.type == "Archive" and .goos == "windows" and .goarch == $arch and owns($name)) | .name] + [$artifacts[0][] | select(.type == "Archive" and .goos == "windows" and .goarch == $arch and owns($name)) | .name | finalize] | if length == 1 then .[0] else error("expected exactly one windows/" + $arch + " archive for " + $name + "; got " + (length|tostring)) end; map(. + {x64_asset: asset(.name; "amd64"), arm64_asset: asset(.name; "arm64")})' } From 1c91a0c5fef72bfea12ac529b6930dab311805e7 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Thu, 3 Sep 2026 18:53:22 -0400 Subject: [PATCH 2/2] fix(release): say how to fix a missing snapshot version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef591c6..7e82d8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -197,7 +197,7 @@ jobs: # version, so rewrite that substring before handing names to the # Windows channels. snapshot_version="$(jq -r '.version' dist/metadata.json)" - [ -n "$snapshot_version" ] && [ "$snapshot_version" != null ] || { echo "::error::dist/metadata.json has no version"; exit 1; } + [ -n "$snapshot_version" ] && [ "$snapshot_version" != null ] || { echo "::error::dist/metadata.json has no version; the snapshot goreleaser step above must write it (check GORELEASER_CURRENT_TAG and the goreleaser config)"; exit 1; } enrich() { printf '%s' "$1" | jq -c --slurpfile artifacts dist/artifacts.json --arg snap "$snapshot_version" --arg final "$VERSION" ' def owns($name):