@@ -181,6 +181,9 @@ jobs:
181181 needs : prepare
182182 if : github.repository_owner == 'llvm'
183183 runs-on : ${{ needs.prepare.outputs.build-runs-on }}
184+ outputs :
185+ digest : ${{ steps.digest.outputs.digest }}
186+ artifact-id : ${{ steps.artifact-upload.outputs.artifact-id }}
184187 steps :
185188
186189 - name : Checkout LLVM
@@ -215,8 +218,17 @@ jobs:
215218 ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
216219 release_dir=`find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname 'stage2-bins'`
217220 mv $release_dir/${{ needs.prepare.outputs.release-binary-filename }} .
218-
221+
222+ - name : Generate sha256 digest for binaries
223+ id : digest
224+ shell : bash
225+ env :
226+ RELEASE_BINARY_FILENAME : ${{ needs.prepare.outputs.release-binary-filename }}
227+ run : |
228+ echo "digest=$(cat $RELEASE_BINARY_FILENAME | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
229+
219230 - uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
231+ id : artifact-upload
220232 with :
221233 name : ${{ runner.os }}-${{ runner.arch }}-release-binary
222234 # Due to path differences on Windows when running in bash vs running on node,
@@ -249,41 +261,15 @@ jobs:
249261 uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
250262 with :
251263 sparse-checkout : |
264+ .github/workflows/upload-release-artifact
252265 llvm/utils/release/github-upload-release.py
253266 llvm/utils/git/requirements.txt
254267 sparse-checkout-cone-mode : false
255268
256- - name : ' Download artifact'
257- uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
258- with :
259- pattern : ' *-release-binary'
260- merge-multiple : true
261-
262- - name : Attest Build Provenance
263- id : provenance
264- uses : actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
265- with :
266- subject-path : ${{ needs.prepare.outputs.release-binary-filename }}
267-
268- - name : Rename attestation file
269- run :
270- mv ${{ steps.provenance.outputs.bundle-path }} ${{ needs.prepare.outputs.release-binary-filename }}.jsonl
271-
272- - name : Upload Build Provenance
273- uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
274- with :
275- name : ${{ needs.prepare.outputs.release-binary-filename }}-attestation
276- path : ${{ needs.prepare.outputs.release-binary-filename }}.jsonl
277-
278- - name : Install Python Requirements
279- run : |
280- pip install --require-hashes -r ./llvm/utils/git/requirements.txt
281-
282- - name : Upload Release
283- shell : bash
284- run : |
285- ./llvm/utils/release/github-upload-release.py \
286- --token ${{ github.token }} \
287- --release ${{ needs.prepare.outputs.release-version }} \
288- upload \
289- --files ${{ needs.prepare.outputs.release-binary-filename }}*
269+ - name : Upload Artifacts
270+ uses : ./.github/workflows/upload-release-artifact
271+ with :
272+ artifact-id : ${{ needs.build-release-package.outputs.artifact-id }}
273+ attestation-name : ${{ needs.prepare.outputs.release-binary-filename }}
274+ digest : ${{ needs.build-release-package.outputs.digest }}
275+ upload : true
0 commit comments