2022-08-04 02:52:57 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
2022-10-24 05:03:55 +08:00
|
|
|
: "${DESTDIR=./bin/release}"
|
|
|
|
|
|
|
|
if [ ! -d "$DESTDIR" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-08-04 02:52:57 +08:00
|
|
|
|
|
|
|
# checksums
|
2022-10-24 05:03:55 +08:00
|
|
|
if ! command shasum > /dev/null 2>&1; then
|
2022-08-04 02:52:57 +08:00
|
|
|
echo >&2 "ERROR: shasum is required"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-24 05:03:55 +08:00
|
|
|
find ./${DESTDIR}/ -type f \( -iname "buildx-*" ! -iname "*darwin*" \) -print0 | sort -z | xargs -r0 shasum -a 256 -b | sed 's# .*/# #' > ./${DESTDIR}/checksums.txt
|
2022-08-04 02:52:57 +08:00
|
|
|
|
|
|
|
# verify
|
|
|
|
(
|
2022-10-24 05:03:55 +08:00
|
|
|
cd ./${DESTDIR}
|
2022-08-04 02:52:57 +08:00
|
|
|
shasum -a 256 -U -c checksums.txt
|
|
|
|
)
|