Skip to content

fix(release): use syft for SBOM generation in goreleaser#9

Merged
CryptoJones merged 1 commit into
mainfrom
fix/26.08-release-sbom
May 27, 2026
Merged

fix(release): use syft for SBOM generation in goreleaser#9
CryptoJones merged 1 commit into
mainfrom
fix/26.08-release-sbom

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Summary

Pre-tag-cutting validation surfaced two bugs in the 26.08 release pipeline:

  1. cyclonedx-gomod can only inspect Go module source trees, not compiled archives — goreleaser's per-archive SBOM step failed with `not a go module`.
  2. The pre-archive SBOM hook created `dist/` before goreleaser was ready, which then refused to start.

Switch to syft via goreleaser's native `sboms:` section. syft inspects the embedded Go BuildInfo of each binary inside the archive and emits a CycloneDX JSON document alongside it.

Verification

```
$ goreleaser release --snapshot --clean --skip=sign

• release succeeded after 11s
$ ls dist/*.cyclonedx.json | wc -l
6
$ /tmp/relsmoke/agent -version
agent 0.0.1-dev
```

Six archives (linux/darwin/windows × amd64/arm64), six matching SBOMs, checksums, working binary with ldflags-injected version.

🤖 Generated with Claude Code

Local snapshot run revealed two issues with the 26.08 release pipeline:

1. cyclonedx-gomod can only inspect Go module source trees, not
   compiled archives, so goreleaser's per-archive SBOM step failed
   with "not a go module".
2. The pre-archive SBOM hook created dist/ before goreleaser was
   ready, which then refused to start.

Switch to syft via goreleaser's native sboms: section. syft inspects
the embedded Go BuildInfo of each binary inside the archive, produces
a CycloneDX JSON document, and emits it alongside the archive.

Verified end-to-end with `goreleaser release --snapshot --clean
--skip=sign`: 6 archives (linux/darwin/windows × amd64/arm64) each
paired with a *.cyclonedx.json SBOM, checksums.txt, and the extracted
agent binary reports its version from the ldflags injection.

Also pulls direct deps (otel, modernc/sqlite, bubbletea, testify) out
of go.mod's indirect block — go mod tidy ran as part of the
goreleaser before-hook and surfaced the existing drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 5a76652 into main May 27, 2026
5 of 6 checks passed
@CryptoJones CryptoJones deleted the fix/26.08-release-sbom branch May 27, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant