Skip to content

Commit b440914

Browse files
aksOpsclaude
andauthored
ci(release): drop goreleaser (prebuilt is Pro-only) — inline sign + release (#50)
The release workflow was failing with: yaml: unmarshal errors: line 19: field prebuilt not found in type config.Build Root cause: the `builder: prebuilt` + `prebuilt.path` config used in .goreleaser.yaml is a GoReleaser Pro-only feature, not supported by OSS goreleaser (which is what the goreleaser-action pins). Rather than buying Pro, inline the release steps directly — the matrix build job already produces native binaries (linux-amd64 on ubuntu, darwin-arm64 on macos); the release job now: 1. Downloads the pre-built binaries 2. Renames them to docsiq-<tag>-<os>-<arch> 3. Computes SHA256SUMS 4. Signs each binary + SHA256SUMS with cosign keyless (Sigstore) 5. Creates a draft GitHub release with auto-generated notes 6. Appends a cosign verify footer to the notes, publishes 7. Generates SLSA build provenance attestation 8. Uploads the provenance bundle to the release What we keep: - Signed binaries (cosign keyless + Rekor transparency log) - Signed SHA256SUMS - SLSA build provenance - Auto-generated GitHub release notes (grouped via .github/release.yml) What we lose: - Scorecard "Packaging" signal (goreleaser detection) — acceptable trade; everything Scorecard actually checks for signed releases (Signed-Releases) still works. .goreleaser.yaml is removed as unused. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c614cdc commit b440914

2 files changed

Lines changed: 57 additions & 95 deletions

File tree

.github/workflows/release.yml

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
if-no-files-found: error
138138

139139
release:
140-
name: goreleaser
140+
name: publish release
141141
needs: [tag, build]
142142
runs-on: ubuntu-latest
143143
permissions:
@@ -149,10 +149,6 @@ jobs:
149149
with:
150150
fetch-depth: 0
151151

152-
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
153-
with:
154-
go-version-file: go.mod
155-
156152
- uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
157153
with:
158154
# v2.x — v3 broke our sign-blob flag compatibility.
@@ -163,39 +159,74 @@ jobs:
163159
pattern: binary-*
164160
path: downloaded/
165161

166-
- name: Lay out prebuilt/ for goreleaser
162+
- name: Assemble versioned binaries + SHA256SUMS
163+
env:
164+
TAG: ${{ needs.tag.outputs.tag }}
167165
run: |
168166
set -eu
169-
mkdir -p prebuilt
167+
mkdir -p dist
170168
for dir in downloaded/binary-*; do
171169
rest=$(basename "$dir" | sed 's/^binary-//')
172170
goos="${rest%-*}"
173171
goarch="${rest##*-}"
174-
target_dir="prebuilt/docsiq_${goos}_${goarch}"
175-
mkdir -p "$target_dir"
176-
cp "$dir/docsiq" "$target_dir/docsiq"
177-
chmod +x "$target_dir/docsiq"
172+
out="dist/docsiq-${TAG}-${goos}-${goarch}"
173+
cp "$dir/docsiq" "$out"
174+
chmod +x "$out"
178175
done
179-
ls -R prebuilt/
176+
(cd dist && sha256sum docsiq-* > SHA256SUMS)
177+
ls -la dist/
178+
179+
- name: Sign artifacts with cosign (keyless)
180+
run: |
181+
set -eu
182+
cd dist
183+
for f in docsiq-* SHA256SUMS; do
184+
cosign sign-blob --yes \
185+
--output-signature="${f}.sig" \
186+
--output-certificate="${f}.pem" \
187+
"$f"
188+
done
189+
ls -la
180190
181191
- name: Create + push tag
182192
env:
183193
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194+
TAG: ${{ needs.tag.outputs.tag }}
184195
run: |
185196
set -eu
186-
tag="${{ needs.tag.outputs.tag }}"
187-
git tag "$tag"
188-
git push origin "$tag"
197+
git tag "$TAG"
198+
git push origin "$TAG"
189199
190-
- name: Run goreleaser
191-
uses: goreleaser/goreleaser-action@e24998b8b67b290c2fa8b7c14fcfa7de2c5c9b8c # v7.1.0
192-
with:
193-
distribution: goreleaser
194-
version: 'v2.15.4'
195-
args: release --clean
200+
- name: Create GitHub release and upload assets
196201
env:
197-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198-
GORELEASER_CURRENT_TAG: ${{ needs.tag.outputs.tag }}
202+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203+
TAG: ${{ needs.tag.outputs.tag }}
204+
run: |
205+
set -eu
206+
# Draft first so we can get the auto-generated body, then edit
207+
# the body to append the cosign Verify footer before publishing.
208+
gh release create "$TAG" \
209+
--title "$TAG" \
210+
--generate-notes \
211+
--draft \
212+
dist/docsiq-* dist/SHA256SUMS dist/SHA256SUMS.sig dist/SHA256SUMS.pem
213+
214+
body=$(gh release view "$TAG" --json body -q .body)
215+
{
216+
printf '%s\n\n' "$body"
217+
printf '### Verify\n\n'
218+
printf 'All artifacts are signed with [cosign](https://github.com/sigstore/cosign) keyless via Sigstore.\n\n'
219+
printf '```sh\n'
220+
printf 'cosign verify-blob \\\n'
221+
printf " --certificate-identity-regexp 'https://github.com/RandomCodeSpace/docsiq/\\\\.github/workflows/release\\\\.yml.*' \\\\\n"
222+
printf " --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \\\\\n"
223+
printf ' --certificate docsiq-%s-linux-amd64.pem \\\n' "$TAG"
224+
printf ' --signature docsiq-%s-linux-amd64.sig \\\n' "$TAG"
225+
printf ' docsiq-%s-linux-amd64\n' "$TAG"
226+
printf '```\n'
227+
} > release-notes.md
228+
229+
gh release edit "$TAG" --notes-file release-notes.md --draft=false
199230
200231
- name: Generate SLSA build provenance
201232
id: attest
@@ -209,8 +240,8 @@ jobs:
209240
- name: Upload provenance to release
210241
env:
211242
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
243+
TAG: ${{ needs.tag.outputs.tag }}
212244
run: |
213245
set -eu
214-
tag="${{ needs.tag.outputs.tag }}"
215-
cp "${{ steps.attest.outputs.bundle-path }}" "docsiq-${tag}.intoto.jsonl"
216-
gh release upload "$tag" "docsiq-${tag}.intoto.jsonl"
246+
cp "${{ steps.attest.outputs.bundle-path }}" "docsiq-${TAG}.intoto.jsonl"
247+
gh release upload "$TAG" "docsiq-${TAG}.intoto.jsonl"

.goreleaser.yaml

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)