Add toolchain expressions like '18 months ago'

This commit is contained in:
David Tolnay 2022-09-25 05:29:24 -07:00
parent 0f2a41247f
commit dab5f91926
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 67 additions and 8 deletions

View file

@ -3,6 +3,8 @@
This GitHub Action installs a Rust toolchain using rustup. It is designed for
one-line concise usage and good defaults.
<br>
## Example workflow
```yaml
@ -24,6 +26,8 @@ Action being requested. For example "dtolnay/rust-toolchain@nightly" pulls in
the nightly Rust toolchain, while "dtolnay/rust-toolchain@1.42.0" pulls in
1.42.0.
<br>
## Inputs
All inputs are optional.
@ -51,6 +55,31 @@ All inputs are optional.
</tr>
</table>
<br>
## Toolchain expressions
The following forms are available for projects that use a sliding window of
compiler support.
```yaml
# Installs the most recent stable toolchain as of the specified time
# offset, which may be written in years, months, weeks, or days.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 18 months ago
```
```yaml
# Installs the stable toolchain which preceded the most recent one by
# the specified number of minor versions.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable minus 8 releases
```
<br>
## License
The scripts and documentation in this project are released under the [MIT