Support multiple targets
This commit is contained in:
parent
88dc235639
commit
eefcf7f616
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.1.0] - 2021-07-19
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `targets` input now takes a comma-separated list of targets rather than a single target
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `target` input is now an alias for `targets`
|
||||||
|
|
||||||
## [1.0.6] - 2020-03-24
|
## [1.0.6] - 2020-03-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -59,7 +59,7 @@ See [additional recipes here](https://github.com/actions-rs/meta).
|
||||||
| Name | Required | Description | Type | Default |
|
| Name | Required | Description | Type | Default |
|
||||||
| ------------ | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------| ------ | --------|
|
| ------------ | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------| ------ | --------|
|
||||||
| `toolchain` | | [Toolchain](https://github.com/rust-lang/rustup.rs#toolchain-specification) name to use, ex. `stable`, `nightly`, `nightly-2019-04-20`, or `1.32.0` | string | stable |
|
| `toolchain` | | [Toolchain](https://github.com/rust-lang/rustup.rs#toolchain-specification) name to use, ex. `stable`, `nightly`, `nightly-2019-04-20`, or `1.32.0` | string | stable |
|
||||||
| `target` | | Additionally install specified target for this toolchain, ex. `x86_64-apple-darwin` | string | |
|
| `targets` | | Comma-separated list of additional targets to install for this toolchain, ex. `x86_64-apple-darwin` | string | |
|
||||||
| `default` | | Set installed toolchain as a default toolchain | bool | false |
|
| `default` | | Set installed toolchain as a default toolchain | bool | false |
|
||||||
| `override` | | Set installed toolchain as an override for the current directory | bool | false |
|
| `override` | | Set installed toolchain as an override for the current directory | bool | false |
|
||||||
| `profile` | | Execute `rustup set profile {value}` before installing the toolchain, ex. `minimal` | string | default |
|
| `profile` | | Execute `rustup set profile {value}` before installing the toolchain, ex. `minimal` | string | default |
|
||||||
|
|
|
@ -13,8 +13,11 @@ 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
|
||||||
target:
|
targets:
|
||||||
description: Target triple to install for this toolchain
|
description: Comma-separated list of additional target triples to install for this toolchain
|
||||||
|
required: false
|
||||||
|
targets:
|
||||||
|
description: Alias for `targets`
|
||||||
required: false
|
required: false
|
||||||
default:
|
default:
|
||||||
description: Set installed toolchain as default
|
description: Set installed toolchain as default
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { existsSync, readFileSync } from "fs";
|
||||||
|
|
||||||
export interface ToolchainOptions {
|
export interface ToolchainOptions {
|
||||||
name: string;
|
name: string;
|
||||||
target: string | undefined;
|
targets: string | undefined;
|
||||||
default: boolean;
|
default: boolean;
|
||||||
override: boolean;
|
override: boolean;
|
||||||
profile: string | undefined;
|
profile: string | undefined;
|
||||||
|
@ -41,9 +41,14 @@ export function getToolchainArgs(overrideFile: string): ToolchainOptions {
|
||||||
components = undefined;
|
components = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let targets: string[] | undefined = input.getInputList("targets") || input.getInputList("target");
|
||||||
|
if (targets && targets.length === 0) {
|
||||||
|
targets = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: determineToolchain(overrideFile),
|
name: determineToolchain(overrideFile),
|
||||||
target: input.getInput("target") || undefined,
|
targets: targets,
|
||||||
default: input.getInputBool("default"),
|
default: input.getInputBool("default"),
|
||||||
override: input.getInputBool("override"),
|
override: input.getInputBool("override"),
|
||||||
profile: input.getInput("profile") || undefined,
|
profile: input.getInput("profile") || undefined,
|
||||||
|
|
|
@ -79,8 +79,10 @@ async function run(): Promise<void> {
|
||||||
|
|
||||||
await rustup.installToolchain(opts.name, installOptions);
|
await rustup.installToolchain(opts.name, installOptions);
|
||||||
|
|
||||||
if (opts.target) {
|
if (opts.targets) {
|
||||||
await rustup.addTarget(opts.target, opts.name);
|
for (const target of opts.targets) {
|
||||||
|
await rustup.addTarget(target, opts.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await versions.gatherInstalledVersions();
|
await versions.gatherInstalledVersions();
|
||||||
|
|
Loading…
Reference in New Issue