mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2025-12-20 13:25:48 +02:00
commit
74ed3f78d0
2 changed files with 17 additions and 16 deletions
15
action.yml
15
action.yml
|
|
@ -6,10 +6,6 @@ branding:
|
|||
color: purple
|
||||
|
||||
inputs:
|
||||
toolchain:
|
||||
description: Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
|
||||
required: false
|
||||
default: 1.80.0
|
||||
targets:
|
||||
description: Comma-separated list of target triples to install for this toolchain
|
||||
required: false
|
||||
|
|
@ -46,7 +42,7 @@ runs:
|
|||
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
env:
|
||||
toolchain: ${{inputs.toolchain}}
|
||||
toolchain: 1.90.0
|
||||
shell: bash
|
||||
|
||||
- id: flags
|
||||
|
|
@ -54,17 +50,22 @@ runs:
|
|||
: construct rustup command line
|
||||
echo "targets=$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" >> $GITHUB_OUTPUT
|
||||
echo "components=$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" >> $GITHUB_OUTPUT
|
||||
echo "downgrade=${{inputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
||||
echo "downgrade=${{steps.parse.outputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
targets: ${{inputs.targets || inputs.target || ''}}
|
||||
components: ${{inputs.components}}
|
||||
shell: bash
|
||||
|
||||
- run: |
|
||||
: set $CARGO_HOME
|
||||
echo CARGO_HOME=${CARGO_HOME:-${{runner.os == 'Windows' && '$USERPROFILE' || '$HOME'}}/.cargo} >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- run: |
|
||||
: install rustup if needed
|
||||
if ! command -v rustup &>/dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
|
||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ fi
|
|||
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
|
||||
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1
|
||||
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
|
||||
)
|
||||
|
||||
releases() {
|
||||
printf "%s\n" 1.{0..80}.0 ${patch_releases[@]} | sort -V
|
||||
printf "%s\n" 1.{0..90}.0 ${patch_releases[@]} | sort -V
|
||||
}
|
||||
|
||||
base=$(git rev-parse HEAD)
|
||||
|
|
@ -29,7 +29,11 @@ for rev in `releases` stable beta nightly; do
|
|||
echo "Updating $rev branch"
|
||||
git checkout --quiet "$base"
|
||||
git branch --quiet --delete --force $rev &>/dev/null || true
|
||||
sed -i "s/required: true/required: false\n default: $rev/" action.yml
|
||||
if [[ $rev == 1* ]]; then
|
||||
sed -i "/^ toolchain:/,+2d; s/\${{inputs\.toolchain}}/$rev/" action.yml
|
||||
else
|
||||
sed -i "s/required: true/required: false\n default: $rev/" action.yml
|
||||
fi
|
||||
git add action.yml
|
||||
git commit --quiet --message "toolchain: $rev"
|
||||
git checkout --quiet -b $rev
|
||||
|
|
@ -43,12 +47,8 @@ for tool in clippy miri; do
|
|||
echo "Updating $tool branch"
|
||||
git checkout --quiet --detach nightly
|
||||
git branch --quiet --delete --force $tool &>/dev/null || true
|
||||
if [ $tool == miri ]; then
|
||||
default="miri, rust-src"
|
||||
echo -e " - uses: dtolnay/install@xargo\n with:\n bin: xargo-check" >> action.yml
|
||||
else
|
||||
default=$tool
|
||||
fi
|
||||
default=$tool
|
||||
if [ $tool == miri ]; then default+=,\ rust-src; fi
|
||||
sed -i "/required: false/{N;s/\n$/\n default: $default\n/}" action.yml
|
||||
git add action.yml
|
||||
git commit --quiet --message "components: $tool"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue