Rename target to targets

This commit is contained in:
Rebecca Turner 2022-07-19 12:21:41 -04:00
parent 6249e8548d
commit fd72fa8a0d
2 changed files with 9 additions and 3 deletions

View file

@ -42,8 +42,8 @@ All inputs are optional.
</td> </td>
</tr> </tr>
<tr> <tr>
<td><code>target</code></td> <td><code>targets</code></td>
<td>Additional target support to install e.g. <code>wasm32-unknown-unknown</code></td> <td>Comma-separated string of additional targets to install e.g. <code>wasm32-unknown-unknown</code></td>
</tr> </tr>
<tr> <tr>
<td><code>components</code></td> <td><code>components</code></td>

View file

@ -9,8 +9,11 @@ inputs:
toolchain: toolchain:
description: Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification description: Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
required: true required: true
targets:
description: Comma-separated list of target triples to install for this toolchain
required: false
target: target:
description: Target triple to install for this toolchain description: Alias for `targets`
required: false required: false
components: components:
description: Comma-separated list of components to be additionally installed description: Comma-separated list of components to be additionally installed
@ -27,6 +30,9 @@ runs:
- id: flags - id: flags
run: | run: |
: construct rustup command line : construct rustup command line
if [[ -z "$targets" ]]; then
targets="$target"
fi
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' || ''}}" echo "::set-output name=downgrade::${{inputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}"