Skip to content
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

ci: Add GitHub artifact attestations to package distribution #3126

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/deploy-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
if: inputs.publish-pypi
permissions:
id-token: write
attestations: write
contents: read
environment:
name: "pypi"
url: "https://pypi.org/project/awkward-cpp/"
Expand All @@ -32,4 +34,9 @@ jobs:
- name: List distributions to be deployed
run: ls -l dist/

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-path: "dist/awkward-cpp-*"

- uses: pypa/[email protected]
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:
name: "Build wheel & sdist"
runs-on: ubuntu-latest
needs: [determine-source-date-epoch]
permissions:
id-token: write
attestations: write
contents: read
env:
SOURCE_DATE_EPOCH: ${{ needs.determine-source-date-epoch.outputs.source-date-epoch }}
steps:
Expand All @@ -83,6 +87,11 @@ jobs:
- name: Check metadata
run: pipx run twine check dist/*

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-path: "dist/awkward-*"

- uses: actions/upload-artifact@v4
with:
name: distributions
Expand Down Expand Up @@ -113,6 +122,19 @@ jobs:
name: distributions
path: dist

- name: List distributions to be deployed
run: ls -l dist/

- name: Verify sdist artifact attestation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh attestation verify dist/awkward-*.tar.gz --repo ${{ github.repository }}

- name: Verify wheel artifact attestation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh attestation verify dist/awkward-*.whl --repo ${{ github.repository }}
Comment on lines +128 to +136
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note related to cli/cli#9215, this is only working currently because there is one wheel. gh attestation verify can't operate on file globs!


- uses: pypa/[email protected]

publish-headers:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:
files: ^tests/

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
rev: 0.28.4
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand Down
Loading