release: attest the sdist provenance, attach the bundle to the release - #56
Merged
Conversation
The release workflow now generates a build provenance attestation for the
sdist, saying that it was built by this workflow from this repository. GitHub
serves it via the attestations API, and the attestation bundle is attached to
the GitHub release as borghash-X.Y.Z.tar.gz.jsonl, too, so that the sdist can
also be verified against that file:
gh attestation verify --owner borgbackup borghash-X.Y.Z.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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The release workflow now generates a build provenance attestation for the sdist, saying that it was built by this workflow from this repository at this commit.
actions/attest-build-provenanceruns after the "is the sdist installable" check, so that we never attest a broken sdist. Same pin as borg uses.releasejob getsid-token: writeandattestations: writefor it.gh attestation verifyuses by default), but the bundle is tiny, so the workflow also copies${{ steps.attest.outputs.bundle-path }}toborghash-X.Y.Z.tar.gz.jsonland attaches it to the GitHub release. Then the sdist can be verified against that file instead of the API, viagh attestation verify --bundle..jsonlis howgh attestation downloadnames such a file.Checked locally: the workflow file parses, the release-notes heredoc renders as intended with the added backtick-quoted commands, and
dist/*.tar.gz dist/*.jsonlexpands to exactly the two assets (the sdist glob does not pick up the bundle, and the PyPI artifact upload still takes onlydist/*.tar.gz).Not tested on a real tag push - that only happens at the next release.