[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / .github / workflows / set-release-binary-outputs.sh
blob9bc459a24e80194d4f5fa076e5d3a8939204f668
1 # Usage: set-release-binary-outputs.sh <github_user> <tag> <upload>
3 set -e
5 if [ -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"
9 fi
11 github_user=$1
12 tag=$2
13 upload=$3
15 if [[ "$github_user" != "tstellar" && "$github_user" != "tru" ]]; then
16 echo "ERROR: User not allowed: $github_user"
17 exit 1
20 if echo $tag | grep -e '^[0-9a-f]\+$'; then
21 # This is a plain commit.
22 # TODO: Don't hardcode this.
23 release_version="18"
24 build_dir="$tag"
25 upload='false'
26 ref="$tag"
27 flags="-git-ref $tag -test-asserts"
29 else
31 pattern='^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$'
32 echo "$tag" | grep -e $pattern
33 if [ $? != 0 ]; then
34 echo "ERROR: Tag '$tag' doesn't match pattern: $pattern"
35 exit 1
37 release_version=`echo "$tag" | sed 's/llvmorg-//g'`
38 release=`echo "$release_version" | sed 's/-.*//g'`
39 build_dir=`echo "$release_version" | sed 's,^[^-]\+,final,' | sed 's,[^-]\+-rc\(.\+\),rc\1,'`
40 rc_flags=`echo "$release_version" | sed 's,^[^-]\+,-final,' | sed 's,[^-]\+-rc\(.\+\),-rc \1 -test-asserts,' | sed 's,--,-,'`
41 flags="-release $release $rc_flags"
43 echo "release-version=$release_version" >> $GITHUB_OUTPUT
44 echo "build-dir=$build_dir" >> $GITHUB_OUTPUT
45 echo "flags=$flags" >> $GITHUB_OUTPUT
46 echo "upload=$upload" >> $GITHUB_OUTPUT
47 echo "ref=$tag" >> $GITHUB_OUTPUT