Merge pull request #25 from 9999years/multiple-targets

Rename `target` to `targets`
This commit is contained in:
David Tolnay 2022-07-20 14:45:07 -07:00 committed by GitHub
commit 4582dac165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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' || ''}}"