2021-10-09 06:17:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
|
|
|
|
|
|
|
|
if ! git diff-index --quiet HEAD; then
|
|
|
|
echo "Not running update-revs.sh because git working directory is dirty" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-06-17 05:07:29 +02:00
|
|
|
patch_releases=(
|
|
|
|
1.12.1 1.15.1 1.22.1 1.24.1 1.26.1 1.26.2 1.27.1 1.27.2 1.29.1 1.29.2 1.30.1
|
|
|
|
1.31.1 1.34.1 1.34.2 1.41.1 1.43.1 1.44.1 1.45.1 1.45.2 1.52.1 1.56.1 1.58.1
|
2024-04-10 14:50:27 +02:00
|
|
|
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1 1.74.1 1.77.1 1.77.2
|
2022-06-17 05:07:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
releases() {
|
2023-06-19 20:00:47 +02:00
|
|
|
printf "%s\n" 1.{0..80}.0 ${patch_releases[@]} | sort -V
|
2022-06-17 05:07:29 +02:00
|
|
|
}
|
|
|
|
|
2021-10-09 06:17:19 +02:00
|
|
|
base=$(git rev-parse HEAD)
|
2022-06-05 01:47:13 +02:00
|
|
|
push=()
|
2021-10-09 06:17:19 +02:00
|
|
|
|
2022-10-25 21:20:58 +02:00
|
|
|
declare -A minor
|
|
|
|
for rev in `releases`; do
|
|
|
|
minor[${rev%.*}]=$rev
|
|
|
|
done
|
|
|
|
|
2022-06-17 05:07:29 +02:00
|
|
|
for rev in `releases` stable beta nightly; do
|
2021-10-09 06:17:19 +02:00
|
|
|
echo "Updating $rev branch"
|
2022-04-25 03:49:29 +02:00
|
|
|
git checkout --quiet "$base"
|
2021-10-09 06:17:19 +02:00
|
|
|
git branch --quiet --delete --force $rev &>/dev/null || true
|
|
|
|
sed -i "s/required: true/required: false\n default: $rev/" action.yml
|
|
|
|
git add action.yml
|
|
|
|
git commit --quiet --message "toolchain: $rev"
|
|
|
|
git checkout --quiet -b $rev
|
2022-06-05 01:47:13 +02:00
|
|
|
push+=("$rev:refs/heads/$rev")
|
2022-10-25 21:37:36 +02:00
|
|
|
if [ "${minor[${rev%.*}]}" == $rev ]; then
|
2022-10-25 21:20:58 +02:00
|
|
|
push+=("$rev:refs/heads/${rev%.*}")
|
|
|
|
fi
|
2021-10-09 06:17:19 +02:00
|
|
|
done
|
2022-04-25 03:49:29 +02:00
|
|
|
|
2022-04-25 03:48:46 +02:00
|
|
|
for tool in clippy miri; do
|
|
|
|
echo "Updating $tool branch"
|
|
|
|
git checkout --quiet --detach nightly
|
|
|
|
git branch --quiet --delete --force $tool &>/dev/null || true
|
2024-04-14 19:48:41 +02:00
|
|
|
default=$tool
|
|
|
|
if [ $tool == miri ]; then default+=,\ rust-src; fi
|
2022-06-29 19:35:00 +02:00
|
|
|
sed -i "/required: false/{N;s/\n$/\n default: $default\n/}" action.yml
|
2022-04-25 03:48:46 +02:00
|
|
|
git add action.yml
|
|
|
|
git commit --quiet --message "components: $tool"
|
|
|
|
git checkout --quiet -b $tool
|
2022-06-05 01:47:13 +02:00
|
|
|
push+=("$tool:refs/heads/$tool")
|
2022-04-25 03:48:46 +02:00
|
|
|
done
|
|
|
|
|
2022-04-25 03:49:29 +02:00
|
|
|
git checkout --quiet "$base"
|
2022-06-05 01:47:13 +02:00
|
|
|
|
|
|
|
echo "git push origin --force-with-lease ${push[@]}"
|