-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgetshas.sh
More file actions
executable file
·27 lines (21 loc) · 881 Bytes
/
getshas.sh
File metadata and controls
executable file
·27 lines (21 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -euo pipefail
getsha() {
shasum -a 256 "$1" | cut -d " " -f1 | xargs
}
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <version>"
exit 1
fi
readonly version=$1
directory=$(mktemp -d)
curl --location --fail --output "$directory/linux_x86_64" "https://whl.modular.com/nightly/mojo-compiler/mojo_compiler-$version-py3-none-manylinux_2_34_x86_64.whl"
curl --location --fail --output "$directory/linux_aarch64" "https://whl.modular.com/nightly/mojo-compiler/mojo_compiler-$version-py3-none-manylinux_2_34_aarch64.whl"
curl --location --fail --output "$directory/macos" "https://whl.modular.com/nightly/mojo-compiler/mojo_compiler-$version-py3-none-macosx_13_0_arm64.whl"
cat <<EOF
"$version": {
"linux_aarch64": "$(getsha "$directory/linux_aarch64")",
"linux_x86_64": "$(getsha "$directory/linux_x86_64")",
"macos_arm64": "$(getsha "$directory/macos")",
}
EOF