From 21a1828626b12bde4a2fe8e8c63c0af494bc8b50 Mon Sep 17 00:00:00 2001 From: Vasil Date: Sat, 24 Oct 2026 15:21:26 +0200 Subject: [PATCH] Release: GoReleaser fills the workflow's draft, not one of its own GoReleaser looks up an existing draft by name; its default name is the tag, while release.yml names the draft "light-tokenmeter X.Y.Z". In 1.1.0 the archives went to a second draft and the published release had none. Publishing now stops when the release has no checksums.txt. --- .github/workflows/release.yml | 2 ++ .goreleaser.yaml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a32b33..0181b8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,5 +100,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + gh release view "$GITHUB_REF_NAME" --json assets -q '.assets[].name' | grep -qx checksums.txt || + { echo "::error::the release has no checksums.txt: the binaries went elsewhere" >&2; exit 1; } top=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || true) gh release edit "$GITHUB_REF_NAME" --draft=false --latest=$([ "$top" = "$GITHUB_REF_NAME" ] && echo true || echo false) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d84ad9c..82f0822 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -35,8 +35,10 @@ signs: signature: "${artifact}.sigstore.json" args: ["sign-blob", "--yes", "--bundle=${signature}", "${artifact}"] -# The release, its notes and its publishing belong to release.yml. +# The release, its notes and its publishing belong to release.yml. GoReleaser +# finds that draft by name, so the name must be the one release.yml gives it. release: + name_template: "light-tokenmeter {{ .Version }}" draft: true use_existing_draft: true mode: keep-existing