Skip to content

Commit ac1c140

Browse files
committed
Do rebar too
1 parent 0c07b6f commit ac1c140

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

scripts/release_rebar.sh

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,37 @@ set -e -u -o pipefail
1616
function main {
1717
installs_dir="$PWD/tmp/installs"
1818
rebar_csv="${installs_dir}/rebar.csv"
19+
rebar_1x_csv="${installs_dir}/rebar3-1.x.csv"
1920

2021
rm -rf "${installs_dir}"
2122
mkdir "${installs_dir}"
2223

23-
# rebar.csv is always rebuilt from scratch. rebar builds are not reproducible, unfortunately.
2424
touch "${rebar_csv}"
2525

26+
s3down rebar3-1.x.csv "${rebar_1x_csv}" || true
27+
touch "${rebar_1x_csv}"
28+
2629
# UPDATE THIS FOR EVERY RELEASE
30+
31+
# Old Elixir versions (old CSV format)
32+
build_old 3.13.3 17.5.6.10 1.0.0 xenial-20200326
33+
build_old 3.15.2 21.3.8.21 1.11.4 xenial-20201014
34+
build_old 3.15.2 22.3.4.22 1.13.0 xenial-20210114
35+
build_old 3.22.0 23.3.4.18 1.14.5 xenial-20210804
36+
build_old 3.22.0 24.3.4.11 1.15.0-rc.0 xenial-20210804
37+
38+
# New Elixir versions (new CSV format)
2739
build 3.22.0 25.3.2.20 1.18.3 noble-20250404
2840
build 3.22.0 26.2.5.11 1.18.3 noble-20250404
2941
build 3.24.0 25.3.2.20 1.18.3 noble-20250404
3042
build 3.24.0 26.2.5.11 1.18.3 noble-20250404
3143
build 3.24.0 27.3.3 1.18.3 noble-20250404
3244
build 3.25.1 28.0.1 1.18.4 noble-20250714
3345

46+
rm -f "${rebar_1x_csv}.bak"
47+
3448
openssl dgst -sha512 -sign "${ELIXIR_PEM}" "${rebar_csv}" | openssl base64 > "${rebar_csv}.signed"
49+
openssl dgst -sha512 -sign "${ELIXIR_PEM}" "${rebar_1x_csv}" | openssl base64 > "${rebar_1x_csv}.signed"
3550
cd $installs_dir
3651
for path in $(find . -type f | sort); do
3752
path="${path#./}"
@@ -49,6 +64,34 @@ function main {
4964
fi
5065
}
5166

67+
# $1 = rebar version
68+
# $2 = erlang version
69+
# $3 = elixir version
70+
# $4 = ubuntu version
71+
function build_old {
72+
rebar_version=$1
73+
otp_version=$2
74+
elixir_version=$3
75+
ubuntu_version=$4
76+
77+
echo "Building ${rebar_version} ${otp_version} ${ubuntu_version} (old format)"
78+
mkdir -p "${installs_dir}/${elixir_version}"
79+
80+
docker run -v "${installs_dir}/${elixir_version}":/installs hexpm/erlang:${otp_version}-ubuntu-${ubuntu_version} sh -c "\
81+
apt update && apt -y install git && \
82+
git clone https://github.com/erlang/rebar3.git -b ${rebar_version} && \
83+
cd rebar3 && \
84+
./bootstrap && \
85+
cp rebar3 /installs/rebar3 && \
86+
cp rebar3 /installs/rebar3-${rebar_version}
87+
"
88+
89+
sed -i.bak "/,${elixir_version}\$/d" "${rebar_1x_csv}"
90+
sha=$(shasum -a 512 "${installs_dir}/${elixir_version}/rebar3")
91+
sha=($sha)
92+
echo "${rebar_version},${sha},${elixir_version}" >> "${rebar_1x_csv}"
93+
}
94+
5295
# $1 = rebar version
5396
# $2 = erlang version
5497
# $3 = elixir version

0 commit comments

Comments
 (0)