-
Notifications
You must be signed in to change notification settings - Fork 45
ci: implement immutable releases support with actions/attest #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8b27a20
6698515
fda68d7
6378f68
21f2567
6a189a1
efadac5
3e77b7b
2bfd140
59d9245
1e7fd43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,9 @@ | ||
| name: Build distribution files | ||
| description: 'Build distribution files' | ||
| outputs: | ||
| package-hashes: | ||
| description: "base64-encoded sha256 hashes of distribution files" | ||
| value: ${{ steps.package-hashes.outputs.package-hashes }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Build distribution files | ||
| shell: bash | ||
| run: poetry build | ||
| - name: Hash build files for provenance | ||
| id: package-hashes | ||
| shell: bash | ||
| working-directory: ./dist | ||
| run: | | ||
| echo "package-hashes=$(sha256sum * | base64 -w0)" >> "$GITHUB_OUTPUT" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,7 @@ jobs: | |
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| outputs: | ||
| package-hashes: ${{ steps.build.outputs.package-hashes}} | ||
| attestations: write # Needed for artifact attestations | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -36,18 +35,13 @@ jobs: | |
| id: build | ||
|
|
||
| - name: Publish package distributions to PyPI | ||
| if: ${{ inputs.dry_run == false }} | ||
| if: ${{ format('{0}', inputs.dry_run) == 'false' }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused
|
||
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | ||
| with: | ||
| password: ${{env.PYPI_AUTH_TOKEN}} | ||
|
|
||
| release-provenance: | ||
| needs: ["build-publish"] | ||
| permissions: | ||
| actions: read | ||
| id-token: write | ||
| contents: write | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0 | ||
| with: | ||
| base64-subjects: "${{ needs.build-publish.outputs.package-hashes }}" | ||
| upload-assets: ${{ !inputs.dry_run }} | ||
| - name: Attest build provenance | ||
| if: ${{ format('{0}', inputs.dry_run) == 'false' }} | ||
| uses: actions/attest@v4 | ||
| with: | ||
| subject-path: 'dist/*' | ||


Uh oh!
There was an error while loading. Please reload this page.