55
55
git push origin $ref_name --force
56
56
57
57
build :
58
+ name : " Build Elixir"
59
+
58
60
strategy :
59
61
fail-fast : true
60
62
matrix :
64
66
- otp : 27
65
67
otp_version : " 27.0"
66
68
build_docs : build_docs
69
+
67
70
runs-on : ubuntu-22.04
71
+
68
72
steps :
69
73
- uses : actions/checkout@v4
70
74
with :
77
81
otp : ${{ matrix.otp }}
78
82
build_docs : ${{ matrix.build_docs }}
79
83
80
- - name : " Attest docs provenance"
81
- uses : actions/attest-build-provenance@v2
82
- id : attest-docs-provenance
83
- if : matrix.build_docs
84
- with :
85
- subject-path : " Docs.zip"
86
-
87
- - name : " Copy docs provenance"
88
- if : matrix.build_docs
89
- run : cp "$ATTESTATION" Docs.zip.sigstore
90
- env :
91
- ATTESTATION : " ${{ steps.attest-docs-provenance.outputs.bundle-path }}"
92
-
93
84
- name : Create Docs Hashes
94
85
if : matrix.build_docs
95
86
run : |
@@ -150,18 +141,6 @@ jobs:
150
141
timestamp-rfc3161 : http://timestamp.acs.microsoft.com
151
142
timestamp-digest : SHA256
152
143
153
- - name : " Attest release provenance"
154
- id : attest-provenance
155
- uses : actions/attest-build-provenance@v2
156
- with :
157
- subject-path : ${{ env.RELEASE_FILE }}
158
-
159
- - name : " Copy release .zip provenance"
160
- shell : bash
161
- run : cp "$ATTESTATION" "${RELEASE_FILE}.sigstore"
162
- env :
163
- ATTESTATION : " ${{ steps.attest-provenance.outputs.bundle-path }}"
164
-
165
144
- name : Create Release Hashes
166
145
if : matrix.flavor == 'windows'
167
146
shell : pwsh
@@ -185,14 +164,92 @@ jobs:
185
164
name : sign-${{ matrix.flavor }}-elixir-otp-${{ matrix.otp }}
186
165
path : ${{ env.RELEASE_FILE }}*
187
166
167
+ sbom :
168
+ name : Generate SBoM
169
+
170
+ needs : [build, sign]
171
+
172
+ runs-on : ubuntu-24.04
173
+
174
+ steps :
175
+ - name : Use HTTPS instead of SSH for Git cloning
176
+ id : git-config
177
+ shell : bash
178
+ run :
git config --global url.https://github.com/.insteadOf ssh://[email protected] /
179
+
180
+ - name : Checkout project
181
+ id : checkout
182
+ uses : actions/checkout@v4
183
+
184
+ - name : " Download Build Artifacts"
185
+ id : download-build-artifacts
186
+ uses : actions/download-artifact@v4
187
+ with :
188
+ pattern : " {sign-*-elixir-otp-*,Docs}"
189
+ merge-multiple : true
190
+ path : /tmp/build-artifacts/
191
+
192
+ - name : " Run OSS Review Toolkit"
193
+ id : ort
194
+ uses : ./.github/workflows/ort
195
+ with :
196
+ build-artifacts : " /tmp/build-artifacts/*"
197
+ report-formats : " CycloneDx,SpdxDocument"
198
+ version : " ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}"
199
+
200
+ - name : Attest Distribution Assets with SBoM
201
+ id : attest-sbom
202
+ uses : actions/attest-sbom@v2
203
+ with :
204
+ subject-path : |
205
+ /tmp/build-artifacts/{elixir-otp-*.*,Docs.zip}
206
+ ${{ steps.ort.outputs.results-sbom-cyclonedx-xml-path }}
207
+ ${{ steps.ort.outputs.results-sbom-cyclonedx-json-path }}
208
+ ${{ steps.ort.outputs.results-sbom-spdx-yml-path }}
209
+ ${{ steps.ort.outputs.results-sbom-spdx-json-path }}
210
+ sbom-path : " ${{ steps.ort.outputs.results-sbom-spdx-json-path }}"
211
+
212
+ - name : " Copy SBoM provenance"
213
+ id : sbom-provenance
214
+ shell : bash
215
+ run : |
216
+ mkdir attestations
217
+
218
+ for FILE in /tmp/build-artifacts/{elixir-otp-*.*,Docs.zip}; do
219
+ cp "$ATTESTATION" "attestations/$(basename "$FILE").sigstore"
220
+ done
221
+
222
+ cp "$ATTESTATION" "attestations/$(basename "${{ steps.ort.outputs.results-sbom-cyclonedx-xml-path }}").sigstore"
223
+ cp "$ATTESTATION" "attestations/$(basename "${{ steps.ort.outputs.results-sbom-cyclonedx-json-path }}").sigstore"
224
+ cp "$ATTESTATION" "attestations/$(basename "${{ steps.ort.outputs.results-sbom-spdx-yml-path }}").sigstore"
225
+ cp "$ATTESTATION" "attestations/$(basename "${{ steps.ort.outputs.results-sbom-spdx-json-path }}").sigstore"
226
+ env :
227
+ ATTESTATION : " ${{ steps.attest-sbom.outputs.bundle-path }}"
228
+
229
+ - name : " Assemble Release SBoM Artifacts"
230
+ uses : actions/upload-artifact@v4
231
+ with :
232
+ name : " SBoM"
233
+ path : |
234
+ ${{ steps.ort.outputs.results-sbom-cyclonedx-xml-path }}
235
+ ${{ steps.ort.outputs.results-sbom-cyclonedx-json-path }}
236
+ ${{ steps.ort.outputs.results-sbom-spdx-yml-path }}
237
+ ${{ steps.ort.outputs.results-sbom-spdx-json-path }}
238
+
239
+ - name : " Assemble Distribution Attestations"
240
+ uses : actions/upload-artifact@v4
241
+ with :
242
+ name : " Attestations"
243
+ path : " attestations/*.sigstore"
244
+
188
245
upload-release :
189
- needs : [create_draft_release, build, sign]
246
+ needs : [create_draft_release, build, sign, sbom ]
190
247
runs-on : ubuntu-22.04
191
248
192
249
steps :
193
250
- uses : actions/download-artifact@v4
194
251
with :
195
- pattern : " {sign-*-elixir-otp-*,Docs}"
252
+ pattern : " {sign-*-elixir-otp-*,Docs,SBoM,Attestations }"
196
253
merge-multiple : true
197
254
198
255
- name : Upload Pre-built
@@ -218,7 +275,8 @@ jobs:
218
275
elixir-otp-*.exe.sigstore \
219
276
Docs.zip \
220
277
Docs.zip.sha{1,256}sum \
221
- Docs.zip.sigstore
278
+ Docs.zip.sigstore \
279
+ bom.*
222
280
223
281
upload-builds-hex-pm :
224
282
needs : [build, sign]
0 commit comments