1# Usage: set-release-binary-outputs.sh <github_user> <tag> <upload> 2 3set -e 4 5if [ -z "$GITHUB_OUTPUT" ]; then 6 export GITHUB_OUTPUT=`mktemp` 7 echo "Warning: Environment variable GITHUB_OUTPUT is not set." 8 echo "Writing output variables to $GITHUB_OUTPUT" 9fi 10 11tag=$1 12upload=$2 13 14if echo $tag | grep -e '^[0-9a-f]\+$'; then 15 # This is a plain commit. 16 # TODO: Don't hardcode this. 17 release_version="18" 18 upload='false' 19 ref="$tag" 20 21else 22 23 pattern='^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$' 24 echo "$tag" | grep -e $pattern 25 if [ $? != 0 ]; then 26 echo "ERROR: Tag '$tag' doesn't match pattern: $pattern" 27 exit 1 28 fi 29 release_version=`echo "$tag" | sed 's/llvmorg-//g'` 30 release=`echo "$release_version" | sed 's/-.*//g'` 31fi 32echo "release-version=$release_version" >> $GITHUB_OUTPUT 33echo "upload=$upload" >> $GITHUB_OUTPUT 34echo "ref=$tag" >> $GITHUB_OUTPUT 35