Skip to content

Commit

Permalink
Add support for attestations
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Forbes <[email protected]>
  • Loading branch information
samypr100 and orf committed Jan 7, 2025
1 parent 3c4fe23 commit d87936f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ jobs:
- pythonbuild
- image
runs-on: depot-ubuntu-22.04
# Permissions used for actions/attest-build-provenance
permissions:
id-token: write
attestations: write
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
fail-fast: false
Expand Down Expand Up @@ -230,6 +234,12 @@ jobs:
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
- name: Generate attestations
uses: actions/attest-build-provenance@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
subject-path: dist/*

- name: Upload Distribution
if: ${{ ! matrix.dry-run }}
uses: actions/upload-artifact@v4
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ jobs:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
fail-fast: false
runs-on: depot-macos-latest
# Permissions used for actions/attest-build-provenance
permissions:
id-token: write
attestations: write
name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -122,6 +126,12 @@ jobs:
./build-macos.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }}
- name: Generate attestations
uses: actions/attest-build-provenance@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
subject-path: dist/*

- name: Upload Distributions
if: ${{ ! matrix.dry-run }}
uses: actions/upload-artifact@v4
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ jobs:
- generate-matrix
- pythonbuild
runs-on: windows-latest-large
# Permissions used for actions/attest-build-provenance
permissions:
id-token: write
attestations: write
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
fail-fast: false
Expand Down Expand Up @@ -132,6 +136,12 @@ jobs:
$Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative
.\pythonbuild.exe validate-distribution --run $Dists
- name: Generate attestations
uses: actions/attest-build-provenance@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
subject-path: dist/*

- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit d87936f

Please sign in to comment.