Skip to content

Commit 47c274c

Browse files
test: test sboms
Signed-off-by: Tiago Castro <tiagolobocastro@gmail.com>
1 parent 13c74fe commit 47c274c

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/image-pr.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ jobs:
2525
with:
2626
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2727
- name: Test building the release images
28-
run: ./scripts/release.sh --skip-publish --build-bins
28+
# SBOMs are generated here too so that a break in the SBOM path is caught
29+
# pre-merge rather than on the develop push. Nothing is signed, since
30+
# nothing is published.
31+
run: ./scripts/release.sh --skip-publish --build-bins --sbom

.github/workflows/image.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- develop
66
- 'release/**'
7+
- sbom
78
workflow_call:
89
inputs:
910
tag:
@@ -35,6 +36,11 @@ jobs:
3536
# todo: once we support multi-arch builds
3637
#- ubuntu-24.04-arm
3738
runs-on: ${{ matrix.runner }}
39+
permissions:
40+
contents: read
41+
packages: write
42+
# Required for cosign to get an OIDC token for keyless signing.
43+
id-token: write
3844
steps:
3945
- uses: actions/checkout@v7
4046
with:
@@ -64,7 +70,14 @@ jobs:
6470
- name: Build and push the release images
6571
run: |
6672
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
67-
./scripts/release.sh --tag ${{ inputs.tag }} --registry ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.namespace }}
73+
./scripts/release.sh --tag ${{ inputs.tag }} --registry ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.namespace }} --sbom --attest
6874
elif [[ "${{ github.event_name }}" == "push" ]]; then
69-
./scripts/release.sh
75+
./scripts/release.sh --registry docker.io/tiagolobocastro --sbom --attest
7076
fi
77+
- name: Upload the SBOMs
78+
if: ${{ always() }}
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: sbom-${{ matrix.runner }}
82+
path: sbom/*.json
83+
if-no-files-found: warn

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ __pycache__
2828
/local-fio-0-verify.state
2929
/report.xml
3030
/docker-logs.txt
31+
/sbom/
3132
/.tmp
3233
/ci-report/
3334
pytest.log

0 commit comments

Comments
 (0)