fix: emit source archive from GoReleaser for attestation coverage#34
Merged
fix: emit source archive from GoReleaser for attestation coverage#34
Conversation
The previous config declared an `archives:` block without a build context, which produced no actual archive — GoReleaser only wrote metadata files to dist/. The `actions/attest-build-provenance` step added in #33 globs `dist/*.tar.gz`, so the first real release (v0.9.0) failed at the attest step with "Could not find subject at path dist/*.tar.gz". Replace the empty `archives:` block with a `source:` block that emits a `{project}-{version}-source.tar.gz` using GoReleaser's built-in source archiver. No build context required; one tar.gz is emitted into dist/ for every release and dry run, which the attestation step then signs under keyless Sigstore. Verified locally: `goreleaser release --snapshot --clean --skip=publish` now produces `dist/syncmap-*-source.tar.gz`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First real release (v0.9.0) failed at the `actions/attest-build-provenance` step:
```
Error: Could not find subject at path dist/*.tar.gz
```
Root cause: the previous `.goreleaser.yml` declared `archives:` without a build context (`builds: [{skip: true}]`), so GoReleaser only wrote metadata files to `dist/` — no tarball.
Fix
Replace the empty `archives:` with a `source:` block that uses GoReleaser's built-in source archiver. No build context required; one `syncmap-{version}-source.tar.gz` is emitted per run.
```yaml
source:
enabled: true
name_template: "{{ .ProjectName }}-{{ .Version }}-source"
format: tar.gz
```
Local snapshot now produces:
```
dist/
├── artifacts.json
├── checksums.txt
├── config.yaml
├── metadata.json
└── syncmap-v0.9.0-SNAPSHOT-7c5343b-source.tar.gz
```
Next steps
After merge: