@@ -70,13 +70,18 @@ jobs:
70
70
cargo binstall cargo-component --force --version ${{ env.CARGO_COMPONENT_VERSION }}
71
71
cargo binstall wkg --force
72
72
cargo binstall cargo-auditable cargo-audit
73
+ cargo binstall auditable2cdx
73
74
74
75
- name : Build the component
75
76
run : cargo auditable component build --release
76
77
77
78
- name : Normalize COMPONENT_NAME and Append .wasm
78
79
run : echo "COMPONENT_NAME_UNDERSCORED=${COMPONENT_NAME//-/_}.wasm" >> $GITHUB_ENV
79
80
81
+ - name : Extract the SBOM from the component
82
+ if : github.event_name != 'workflow_dispatch'
83
+ run : auditable2cdx target/wasm32-wasip1/release/${{ env.COMPONENT_NAME_UNDERSCORED }} >> ${ env.COMPONENT_NAME }.spdx.json
84
+
80
85
- name : Publish `:<version>` to GitHub Container Registry
81
86
if : github.event_name != 'workflow_dispatch'
82
87
id : publish_versioned
94
99
if : github.event_name != 'workflow_dispatch'
95
100
run : cosign sign --yes ghcr.io/${{ env.IMAGE_NAME }}/${{ env.COMPONENT_NAME }}@${{ steps.publish_versioned.outputs.digest }}
96
101
102
+ - name : Sign the SBOM for the versioned Wasm component
103
+ if : github.event_name != 'workflow_dispatch'
104
+ run : cosign attest --type spdxjson --predicate ${ env.COMPONENT_NAME }.spdx.json ${{ steps.publish_versioned.outputs.digest }}
105
+
97
106
- name : Publish `:latest` release to GitHub Container Registry
98
107
if : github.event_name != 'workflow_dispatch'
99
108
id : publish_latest
@@ -111,3 +120,6 @@ jobs:
111
120
if : github.event_name != 'workflow_dispatch'
112
121
run : cosign sign --yes ghcr.io/${{ env.IMAGE_NAME }}/${{ env.COMPONENT_NAME }}@${{ steps.publish_latest.outputs.digest }}
113
122
123
+ - name : Sign the SBOM for the latest Wasm component
124
+ if : github.event_name != 'workflow_dispatch'
125
+ run : cosign attest --type spdxjson --predicate ${ env.COMPONENT_NAME }.spdx.json ${{ steps.publish_latest.outputs.digest }}
0 commit comments