|
15 | 15 | - ".ci/requirements-sbom.txt" |
16 | 16 | - ".github/compare-dist-sizes.py" |
17 | 17 | - ".github/dependencies.json" |
| 18 | + - ".github/embed-sbom.py" |
18 | 19 | - ".github/generate-sbom.py" |
19 | 20 | - ".github/workflows/wheels*" |
20 | 21 | - "pyproject.toml" |
|
40 | 41 | FORCE_COLOR: 1 |
41 | 42 |
|
42 | 43 | jobs: |
| 44 | + sbom: |
| 45 | + if: github.event_name != 'schedule' || github.event.repository.fork == false |
| 46 | + runs-on: ubuntu-latest |
| 47 | + name: Generate SBOM |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 50 | + with: |
| 51 | + persist-credentials: false |
| 52 | + |
| 53 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 54 | + with: |
| 55 | + python-version: "3.x" |
| 56 | + |
| 57 | + - name: Generate CycloneDX SBOM |
| 58 | + run: python3 .github/generate-sbom.py |
| 59 | + |
| 60 | + - name: Validate SBOM |
| 61 | + run: | |
| 62 | + python3 -m pip install -r .ci/requirements-sbom.txt |
| 63 | + check-jsonschema --schemafile "https://raw.githubusercontent.com/CycloneDX/specification/1.7/schema/bom-1.7.schema.json" pillow-*.cdx.json |
| 64 | +
|
| 65 | + - name: Upload SBOM as workflow artifact |
| 66 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 67 | + with: |
| 68 | + name: sbom |
| 69 | + path: "pillow-*.cdx.json" |
| 70 | + |
43 | 71 | build-native-wheels: |
| 72 | + needs: sbom |
44 | 73 | if: github.event_name != 'schedule' || github.event.repository.fork == false |
45 | 74 | name: ${{ matrix.name }} |
46 | 75 | runs-on: ${{ matrix.os }} |
@@ -128,12 +157,22 @@ jobs: |
128 | 157 | CIBW_ENVIRONMENT_PASS_LINUX: FORCE_COLOR |
129 | 158 | MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} |
130 | 159 |
|
| 160 | + - name: Download SBOM |
| 161 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 162 | + with: |
| 163 | + name: sbom |
| 164 | + path: sbom |
| 165 | + |
| 166 | + - name: Embed SBOM in wheels |
| 167 | + run: python3 .github/embed-sbom.py wheelhouse sbom |
| 168 | + |
131 | 169 | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
132 | 170 | with: |
133 | 171 | name: dist-${{ matrix.name }} |
134 | 172 | path: ./wheelhouse/*.whl |
135 | 173 |
|
136 | 174 | windows: |
| 175 | + needs: sbom |
137 | 176 | if: github.event_name != 'schedule' || github.event.repository.fork == false |
138 | 177 | name: Windows ${{ matrix.cibw_arch }} |
139 | 178 | runs-on: ${{ matrix.os }} |
@@ -207,6 +246,15 @@ jobs: |
207 | 246 | powershell C:\pillow\.github\workflows\wheels-test.ps1 %CD%\..\venv-test' |
208 | 247 | shell: bash |
209 | 248 |
|
| 249 | + - name: Download SBOM |
| 250 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 251 | + with: |
| 252 | + name: sbom |
| 253 | + path: sbom |
| 254 | + |
| 255 | + - name: Embed SBOM in wheels |
| 256 | + run: python3 .github/embed-sbom.py wheelhouse sbom |
| 257 | + |
210 | 258 | - name: Upload wheels |
211 | 259 | uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
212 | 260 | with: |
@@ -299,33 +347,6 @@ jobs: |
299 | 347 | artifacts_path: dist |
300 | 348 | anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} |
301 | 349 |
|
302 | | - sbom: |
303 | | - if: github.event_name != 'schedule' || github.event.repository.fork == false |
304 | | - runs-on: ubuntu-latest |
305 | | - name: Generate SBOM |
306 | | - steps: |
307 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
308 | | - with: |
309 | | - persist-credentials: false |
310 | | - |
311 | | - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
312 | | - with: |
313 | | - python-version: "3.x" |
314 | | - |
315 | | - - name: Generate CycloneDX SBOM |
316 | | - run: python3 .github/generate-sbom.py |
317 | | - |
318 | | - - name: Upload SBOM as workflow artifact |
319 | | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
320 | | - with: |
321 | | - name: sbom |
322 | | - path: "pillow-*.cdx.json" |
323 | | - |
324 | | - - name: Validate SBOM |
325 | | - run: | |
326 | | - python3 -m pip install -r .ci/requirements-sbom.txt |
327 | | - check-jsonschema --schemafile "https://raw.githubusercontent.com/CycloneDX/specification/1.7/schema/bom-1.7.schema.json" pillow-*.cdx.json |
328 | | -
|
329 | 350 | sbom-publish: |
330 | 351 | if: | |
331 | 352 | github.event.repository.fork == false |
|
0 commit comments