Skip to content

Commit bc7f4d5

Browse files
committedMar 21, 2025
[ci] Add artifact attestation to build
Adds a signed build provenance attestations via https://github.com/actions/attest-build-provenance
1 parent e0aa150 commit bc7f4d5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
 

‎.github/workflows/runtime_build_and_test.yml

+25
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,37 @@ jobs:
332332
- name: Display structure of build
333333
run: ls -R build
334334
- name: Archive build
335+
id: upload_build
335336
uses: actions/upload-artifact@v4
336337
with:
337338
name: _build_${{ matrix.worker_id }}_${{ matrix.release_channel }}
338339
path: build
339340
if-no-files-found: error
340341

342+
attest_build:
343+
name: Generate signed build provenance attestations
344+
runs-on: ubuntu-latest
345+
needs: [build_and_lint]
346+
permissions:
347+
# Attestation for build: https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#generating-build-provenance-for-binaries
348+
id-token: write
349+
contents: read
350+
attestations: write
351+
steps:
352+
- name: Restore archived build
353+
uses: actions/download-artifact@v4
354+
with:
355+
pattern: _build_*
356+
path: build
357+
merge-multiple: true
358+
- name: Display structure of build
359+
run: ls -R build
360+
- name: Calculate build digest
361+
run: find build -type f -print0 | LC_ALL=C sort -z | xargs -0 shasum -a 256 > subject.checksums.txt
362+
- uses: actions/attest-build-provenance@v2
363+
with:
364+
subject-checksums: subject.checksums.txt
365+
341366
test_build:
342367
name: yarn test-build
343368
needs: [build_and_lint, runtime_compiler_node_modules_cache]

0 commit comments

Comments
 (0)
Failed to load comments.