ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
50 lines
1.1 KiB
Bash
50 lines
1.1 KiB
Bash
#!/usr/bin/env sh
|
|
set -eu
|
|
|
|
repo_root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
|
|
cd "$repo_root"
|
|
|
|
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | sed -n '1p')"
|
|
out_dir="${DOSH_PACKAGE_DIR:-target/dosh-release}"
|
|
|
|
artifact_version() {
|
|
artifact="$1"
|
|
case "$artifact" in
|
|
*.tar.gz)
|
|
tar -xOf "$artifact" dosh/VERSION 2>/dev/null | tr -d '\r\n'
|
|
;;
|
|
*.zip)
|
|
unzip -p "$artifact" dosh/VERSION 2>/dev/null | tr -d '\r\n'
|
|
;;
|
|
*)
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
if [ "$#" -gt 0 ]; then
|
|
artifacts="$*"
|
|
else
|
|
artifacts="$out_dir/dosh-linux-x86_64.tar.gz $out_dir/dosh-macos-aarch64.tar.gz $out_dir/dosh-windows-x86_64.zip"
|
|
fi
|
|
|
|
failed=0
|
|
for artifact in $artifacts; do
|
|
if [ ! -f "$artifact" ]; then
|
|
echo "missing release artifact: $artifact" >&2
|
|
failed=1
|
|
continue
|
|
fi
|
|
if [ ! -f "$artifact.sha256" ]; then
|
|
echo "missing release checksum: $artifact.sha256" >&2
|
|
failed=1
|
|
fi
|
|
actual="$(artifact_version "$artifact" || true)"
|
|
if [ "$actual" != "$version" ]; then
|
|
echo "artifact version mismatch: $artifact has ${actual:-unknown}, expected $version" >&2
|
|
failed=1
|
|
fi
|
|
done
|
|
|
|
exit "$failed"
|