3
0
Fork 0
mirror of https://github.com/dtolnay/rust-toolchain.git synced 2024-11-22 08:49:30 +01:00

Emit allow-downgrade flag only on nightly with components

This commit is contained in:
David Tolnay 2021-10-09 06:06:28 +01:00
parent c1964a6b50
commit 1bccaa1715
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -26,12 +26,13 @@ runs:
: construct rustup command line : construct rustup command line
echo "::set-output name=targets::$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" echo "::set-output name=targets::$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)"
echo "::set-output name=components::$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" echo "::set-output name=components::$(for c in ${components//,/ }; do echo -n ' --component' $c; done)"
echo "::set-output name=downgrade::${{inputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}"
env: env:
targets: ${{inputs.target}} targets: ${{inputs.target}}
components: ${{inputs.components}} components: ${{inputs.components}}
shell: bash shell: bash
- name: rustup toolchain install ${{inputs.toolchain}} - name: rustup toolchain install ${{inputs.toolchain}}
run: rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal --allow-downgrade --no-self-update run: rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
shell: bash shell: bash
- run: rustup default ${{inputs.toolchain}} - run: rustup default ${{inputs.toolchain}}
shell: bash shell: bash