Skip to content

Commit ae14374

Browse files
committed
Test multiple Erlang versions looking for SHA256
It appears that the failure of https://github.com/erlang/otp/runs/1830857603?check_suite_focus=true has caused https://github.com/erlang/otp/releases/tag/OTP-23.2.4 to be missing several artifacts we now rely on, and this lets our script skip that version and thus still succeed.
1 parent 496f4b6 commit ae14374

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

versions.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,28 @@ for version in "${versions[@]}"; do
6565
export fullVersion
6666

6767
otpMajor="${otpMajors[$rcVersion]}"
68-
otpVersion="$(
68+
otpVersions=( $(
6969
git ls-remote --tags https://github.com/erlang/otp.git \
7070
"refs/tags/OTP-$otpMajor.*"\
7171
| cut -d'/' -f3- \
7272
| cut -d'^' -f1 \
7373
| cut -d- -f2- \
74-
| sort -uV \
75-
| tail -1
76-
)"
74+
| sort -urV
75+
) )
76+
otpVersion=
77+
for possibleVersion in "${otpVersions[@]}"; do
78+
if otpSourceSha256="$(
79+
wget -qO- "https://github.com/erlang/otp/releases/download/OTP-$possibleVersion/SHA256.txt" \
80+
| awk -v v="$possibleVersion" '$2 == "otp_src_" v ".tar.gz" { print $1 }'
81+
)"; then
82+
otpVersion="$possibleVersion"
83+
break
84+
fi
85+
done
7786
if [ -z "$otpVersion" ]; then
7887
echo >&2 "warning: failed to get Erlang/OTP version for '$version' ($fullVersion); skipping"
7988
continue
8089
fi
81-
otpSourceSha256="$(
82-
wget -qO- "https://github.com/erlang/otp/releases/download/OTP-$otpVersion/SHA256.txt" \
83-
| awk -v v="$otpVersion" '$2 == "otp_src_" v ".tar.gz" { print $1 }'
84-
)"
85-
if [ -z "$otpSourceSha256" ]; then
86-
echo >&2 "error: failed to get Erlang/OTP SHA256 for '$otpVersion' ('$version' / '$fullVersion')"
87-
exit 1
88-
fi
8990
export otpVersion otpSourceSha256
9091

9192
opensslMajor="${opensslMajors[$rcVersion]}"

0 commit comments

Comments
 (0)