|
| 1 | +name: Sign Release Artifacts |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [created] # Trigger only when a new release is *created* |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: write # Needed to upload release assets |
| 9 | + id-token: write # Needed for OIDC authentication with Sigstore |
| 10 | + |
| 11 | +jobs: |
| 12 | + sign: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + persist-credentials: false # Avoid keeping credentials around longer than needed |
| 18 | + |
| 19 | + - name: Set up Python # This step is CRUCIAL |
| 20 | + uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + python-version: '3.10' # Or another supported version, matching your project |
| 23 | + |
| 24 | + - name: Install dependencies (including your package in editable mode) |
| 25 | + run: | |
| 26 | + python -m pip install --upgrade pip |
| 27 | + pip install -e . # Install your package (so it's available to the signing action) |
| 28 | +
|
| 29 | + - name: Sign Script with Sigstore |
| 30 | + |
| 31 | + with: |
| 32 | + inputs: feldman_vss.py |
| 33 | + README.md |
| 34 | + LICENSE |
| 35 | + # Optional: Sign other files too, e.g., a README or LICENSE |
| 36 | + # inputs: | |
| 37 | + # feldman_vss.py |
| 38 | + # README.md |
| 39 | + # LICENSE |
| 40 | + release-signing-artifacts: true # Upload signatures as release assets |
| 41 | + upload-signing-artifacts: true # Also upload as workflow artifacts (for debugging) |
| 42 | + |
| 43 | + # Optional: Verify the signature (good practice) |
| 44 | + - name: Verify Signature |
| 45 | + if: always() # Run verification even if signing fails (for diagnostics) |
| 46 | + |
| 47 | + with: |
| 48 | + inputs: feldman_vss_current.py |
| 49 | + verify: true |
| 50 | + # We know the identity because it will be the GitHub Actions bot. |
| 51 | + # The format is {actor}@users.noreply.github.com |
| 52 | + verify-cert-identity: ${{ github.actor }}@users.noreply.github.com |
| 53 | + verify-oidc-issuer: https://token.actions.githubusercontent.com |
0 commit comments