#!/usr/bin/env bash set -e set -o pipefail if [ $# -ne 2 ]; then echo "usage: $0 VERSION RELEASE_DIRECTORY" exit 1 fi version="$1" release_directory="$2" file="share/ruby-build/truffleruby+graalvm-${version}" add_platform() { platform="$1" if [[ "$version" = *preview* ]]; then basename="graalvm-ruby-community-${version}-jdk17-${platform}.tar.gz" url="https://github.com/oracle/truffleruby/releases/download/vm-${version}/${basename}" else basename="graalvm-ce-java17-${platform}-${version}.tar.gz" url="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${version}/${basename}" fi sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1) cat >> "$file" < "$file" <> "$file" <> "$file" <> "$file" <> "$file" <