Create checksums for artifacts

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/674/head
CrazyMax 3 years ago
parent 65a6955db8
commit 85dedf1aea
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -164,6 +164,7 @@ jobs:
./hack/release ${{ env.RELEASE_OUT }}
env:
PLATFORMS: ${{ env.PLATFORMS }},darwin/amd64,darwin/arm64,windows/amd64,windows/arm64
CHECKSUMS: 1
CACHEDIR_FROM: /tmp/.buildx-cache/${{ env.CACHEKEY_BINARIES }}
-
name: Upload artifacts

@ -6,6 +6,7 @@ OUT=${1:-release-out}
set -eu -o pipefail
: ${PLATFORMS=linux/amd64}
: ${CHECKSUMS=}
importCacheFlags=""
if [[ -n "$cacheRefFrom" ]] && [[ "$cacheType" = "local" ]]; then
@ -26,3 +27,11 @@ if [[ $PLATFORMS =~ "," ]]; then
mv -f ./$OUT/**/* ./$OUT/
find ./$OUT -type d -empty -delete
fi
if [ -n "$CHECKSUMS" ]; then
if ! type shasum > /dev/null 2>&1; then
echo >&2 "ERROR: shasum is required"
exit 1
fi
find ./$OUT/ -type f \( -iname "buildx-*" ! -iname "*darwin*" \) -print0 | sort -z | xargs -r0 shasum -a 256 -b | sed 's# .*/# #' > ./$OUT/checksums.txt
fi

Loading…
Cancel
Save