|
29 | 29 | - name: Build a binary wheel and a source tarball |
30 | 30 | run: python3 -m build |
31 | 31 |
|
| 32 | + - name: Generate CycloneDX SBOM |
| 33 | + uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 |
| 34 | + with: |
| 35 | + path: ./ |
| 36 | + format: 'cyclonedx-json' |
| 37 | + output-file: 'dist/agentshield-python-cyclonedx.sbom.json' |
| 38 | + artifact-name: 'agentshield-python-cyclonedx.sbom.json' |
| 39 | + upload-artifact: true |
| 40 | + upload-release-assets: false |
| 41 | + |
| 42 | + - name: Generate SPDX SBOM |
| 43 | + uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 |
| 44 | + with: |
| 45 | + path: ./ |
| 46 | + format: 'spdx-json' |
| 47 | + output-file: 'dist/agentshield-python-spdx.sbom.json' |
| 48 | + artifact-name: 'agentshield-python-spdx.sbom.json' |
| 49 | + upload-artifact: true |
| 50 | + upload-release-assets: false |
| 51 | + |
32 | 52 | - name: Store the distribution packages |
33 | 53 | uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.0 |
34 | 54 | with: |
|
58 | 78 | uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.12.4 |
59 | 79 | with: |
60 | 80 | password: ${{ secrets.PYPI_API_TOKEN }} |
61 | | - skip-existing: true |
| 81 | + |
| 82 | + create-release: |
| 83 | + name: Create GitHub Release with SBOM Artifacts |
| 84 | + needs: |
| 85 | + - publish-to-pypi |
| 86 | + if: startsWith(github.ref, 'refs/tags/v') |
| 87 | + runs-on: ubuntu-latest |
| 88 | + permissions: |
| 89 | + contents: write |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 92 | + |
| 93 | + - name: Download all the dists |
| 94 | + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.0 |
| 95 | + with: |
| 96 | + name: python-package-distributions |
| 97 | + path: dist/ |
| 98 | + |
| 99 | + - name: Create GitHub Release |
| 100 | + uses: softprops/action-gh-release@c062e08bd5328157348241fa0833b7d8b97943b7 # v2.0.8 |
| 101 | + with: |
| 102 | + generate_release_notes: true |
| 103 | + files: | |
| 104 | + dist/* |
| 105 | + env: |
| 106 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments