ci: release a checksums file with SHA256 hashes for release assets (#2227)

* ci: generate sha256 checksums for release assets

Signed-off-by: Vishwas Rajashekar <vrajashe@cisco.com>

* ci: add wildcard character prefix to filenames in checksum file

Signed-off-by: Vishwas Rajashekar <vrajashe@cisco.com>

---------

Signed-off-by: Vishwas Rajashekar <vrajashe@cisco.com>
This commit is contained in:
Vishwas R 2024-02-05 23:49:48 +05:30 committed by GitHub
parent e3065f6a2c
commit b332b43fb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -98,3 +98,33 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
release-checksums:
name: Release Artifact Checksums
needs: build-arch
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Download Release Artifacts
uses: robinraju/release-downloader@v1.9
with:
tag: ${{ github.ref_name }}
fileName: "z*"
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: z*
method: sha256
output: checksums.sha256.txt
- name: Add wildcard character prefix to filenames in checksum file
run: sed -i 's! ! \*!g' checksums.sha256.txt
- name: Publish checksums on releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: checksums.sha256.txt
tag: ${{ github.ref }}
overwrite: true