mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2025-06-07 19:26:37 +00:00
Add script to update revs
This commit is contained in:
parent
5f8a325e9a
commit
f93393c7fd
2 changed files with 27 additions and 0 deletions
|
@ -13,6 +13,7 @@ inputs:
|
||||||
|
|
||||||
If this is not given, the action will try and install the version specified in the `rust-toolchain` file.
|
If this is not given, the action will try and install the version specified in the `rust-toolchain` file.
|
||||||
required: false
|
required: false
|
||||||
|
#default: ${{ rev }}
|
||||||
target:
|
target:
|
||||||
description: Target triple to install for this toolchain
|
description: Target triple to install for this toolchain
|
||||||
required: false
|
required: false
|
||||||
|
|
26
scripts/update-revs.sh
Executable file
26
scripts/update-revs.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/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
|
||||||
|
|
||||||
|
if ! grep -q "#default: \${{ rev }}" action.yml; then
|
||||||
|
echo "Not running update-revs.sh because action.yml looks wrong" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base=$(git rev-parse HEAD)
|
||||||
|
git checkout --quiet "$base"
|
||||||
|
|
||||||
|
for rev in 1.{0..43}.0 stable beta nightly; do
|
||||||
|
echo "Updating $rev branch"
|
||||||
|
git branch --quiet --delete --force $rev &>/dev/null || true
|
||||||
|
sed -i "s/#default: \${{ rev }}/default: $rev/" action.yml
|
||||||
|
git add action.yml
|
||||||
|
git commit --quiet --message "toolchain: $rev"
|
||||||
|
git checkout --quiet -b $rev
|
||||||
|
git checkout --quiet "$base"
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue