From d15787c6530f8f9c890a339b6a5cae94ca3bc95a Mon Sep 17 00:00:00 2001 From: jerky676 Date: Wed, 11 Nov 2026 08:06:37 -0600 Subject: [PATCH] Replace softprops release with gh release, SBOM and attestations in python-build-artifacts Generate a CycloneDX SBOM, attest it and build provenance for dist/*, and create the release via gh CLI, matching vscode-ext-release. Callers must now grant attestations: write and id-token: write. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/actions.lock | 21 +++++------ .github/workflows/python-build-artifacts.yml | 37 ++++++++++++++++---- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index c1deff8..56a86df 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -28,17 +28,19 @@ workflows: '.github/workflows/local-pr.yml': - 'actions/checkout@v7.0.1' '.github/workflows/python-build-artifacts.yml': + - 'actions/attest-build-provenance@v4.2.2' + - 'actions/attest@v4.2.2' - 'actions/checkout@v7.0.1' - - 'actions/setup-python@v7.0.0' + - 'actions/setup-python@v7.1.0' - 'actions/upload-artifact@v7.0.2' - - 'softprops/action-gh-release@v3.0.3' + - 'anchore/sbom-action@v0.24.3' '.github/workflows/python-package-check.yml': - 'actions/checkout@v7.0.1' - - 'actions/setup-python@v7.0.0' + - 'actions/setup-python@v7.1.0' '.github/workflows/python-pr-check.yml': - '96daysleft/github-workflows@release' - 'actions/checkout@v7.0.1' - - 'actions/setup-python@v7.0.0' + - 'actions/setup-python@v7.1.0' - 'the-pr-agent/pr-agent@v0.48.0' '.github/workflows/typescript-build.yml': - 'actions/checkout@v7.0.1' @@ -105,9 +107,9 @@ dependencies: commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1' owner_id: 44036562 repo_id: 189476904 - 'actions/setup-python@v7.0.0': - ref: 'v7.0.0' - commit: 'sha1-5fda3b95a4ea91299a34e894583c3862153e4b97' + 'actions/setup-python@v7.1.0': + ref: 'v7.1.0' + commit: 'sha1-6d4fd22b20465ccc0f7354476588e8df7c9ca0e0' owner_id: 44036562 repo_id: 192625525 'actions/upload-artifact@v7.0.2': @@ -145,11 +147,6 @@ dependencies: commit: 'sha1-f87e5991a6d7451dcb8d9637bfbc97413f497069' owner_id: 5429470 repo_id: 288485773 - 'softprops/action-gh-release@v3.0.3': - ref: 'v3.0.3' - commit: 'sha1-efb35369e0ad2afab669f228072c1b0d510eae64' - owner_id: 2242 - repo_id: 204253808 'the-pr-agent/pr-agent@v0.48.0': ref: 'v0.48.0' commit: 'sha1-981344be2755e303df501e18e3f60b848a188a80' diff --git a/.github/workflows/python-build-artifacts.yml b/.github/workflows/python-build-artifacts.yml index 5b447b1..8f9abeb 100644 --- a/.github/workflows/python-build-artifacts.yml +++ b/.github/workflows/python-build-artifacts.yml @@ -29,6 +29,10 @@ jobs: permissions: packages: write contents: write + id-token: write # OIDC token for attestation signing + attestations: write # SBOM + build provenance attestations + env: + SBOM_NAME: sbom.cdx.json steps: - name: Checkout @@ -74,10 +78,31 @@ jobs: name: python-package-distributions path: dist/ - - name: Create a Release - uses: softprops/action-gh-release@v3.0.3 + - name: Generate SBOM + uses: anchore/sbom-action@v0.24.3 with: - tag_name: ${{ env.FULL_TAG }} - name: ${{ env.FULL_TAG }} - generate_release_notes: true - files: dist/* + path: . + format: cyclonedx-json + output-file: ${{ env.SBOM_NAME }} + + - name: Attest SBOM + uses: actions/attest@v4.2.2 + with: + subject-path: dist/* + sbom-path: ${{ env.SBOM_NAME }} + + - name: Attest build provenance + uses: actions/attest-build-provenance@v4.2.2 + with: + subject-path: dist/* + + - name: Create GitHub Release with assets + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ env.FULL_TAG }} + run: | + gh release create "${RELEASE_TAG}" \ + --title "${RELEASE_TAG}" \ + --generate-notes \ + dist/* \ + "${SBOM_NAME}"