Files
install-action/README.md

141 lines
5.2 KiB
Markdown
Raw Normal View History

<!-- omit in toc -->
2021-12-30 17:33:20 +09:00
# install-action
2022-12-29 04:18:41 +09:00
[![release](https://img.shields.io/github/release/taiki-e/install-action?style=flat-square&logo=github)](https://github.com/taiki-e/install-action/releases/latest)
2024-01-09 00:39:53 +09:00
[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/install-action/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/install-action/actions)
2021-12-30 17:33:20 +09:00
GitHub Action for installing development tools (mainly from GitHub Releases).
- [Usage](#usage)
- [Inputs](#inputs)
- [Example workflow](#example-workflow)
- [Supported tools](#supported-tools)
2023-06-09 22:55:04 +09:00
- [Add support for new tool](#add-support-for-new-tool)
2021-12-30 17:33:20 +09:00
- [Security](#security)
2022-12-14 11:47:44 +09:00
- [Compatibility](#compatibility)
2021-12-30 17:33:20 +09:00
- [Related Projects](#related-projects)
- [License](#license)
## Usage
### Inputs
2022-12-24 21:49:18 +09:00
| Name | Required | Description | Type | Default |
| -------- |:--------:| --------------------------------------- | ------- | ------- |
| tool | **true** | Tools to install (comma-separated list) | String | |
| checksum | false | Whether to enable checksums | Boolean | `true` |
2021-12-30 17:33:20 +09:00
### Example workflow
2023-01-16 09:19:14 +09:00
To install the latest version:
2021-12-30 17:33:20 +09:00
```yaml
2022-12-25 23:28:15 +09:00
- uses: taiki-e/install-action@v2
2021-12-30 17:33:20 +09:00
with:
tool: cargo-hack
```
You can use the shorthand (if you do not need to pin the versions of this action and the installed tool):
```yaml
- uses: taiki-e/install-action@cargo-hack
```
To install a specific version, use `@version` syntax:
```yaml
2022-12-25 23:28:15 +09:00
- uses: taiki-e/install-action@v2
2021-12-30 17:33:20 +09:00
with:
2022-12-04 06:45:42 +09:00
tool: cargo-hack@0.5.24
2021-12-30 17:33:20 +09:00
```
2022-12-25 23:28:15 +09:00
You can also omit patch version.
(You can also omit the minor version if the major version is 1 or greater.)
```yaml
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack@0.5
```
2021-12-30 17:33:20 +09:00
To install multiple tools:
```yaml
2022-12-25 23:28:15 +09:00
- uses: taiki-e/install-action@v2
2021-12-30 17:33:20 +09:00
with:
tool: cargo-hack,cargo-minimal-versions
```
Or:
```yaml
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
```
## Supported tools
See [TOOLS.md](TOOLS.md) for the list of tools that are installed from manifests managed in this action.
2024-06-04 04:03:00 +09:00
If a tool not included in the list above is specified, this action uses [cargo-binstall] as a fallback.
2023-06-09 22:55:04 +09:00
If you want to ensure that fallback is not used, use `fallback: none`.
```yaml
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
# Possible values:
# - none: disable all fallback
# - cargo-binstall (default): cargo-binstall (includes quickinstall)
fallback: none
```
2023-06-09 22:55:04 +09:00
### Add support for new tool
See the [development guide](DEVELOPMENT.md) for how to add support for new tool.
2021-12-30 17:33:20 +09:00
## Security
When installing the tool from GitHub Releases, this action will download the tool or its installer from GitHub Releases using HTTPS with tlsv1.2+. This is basically considered to be the same level of security as [the recommended installation of rustup](https://www.rust-lang.org/tools/install).
2022-12-24 21:49:18 +09:00
Additionally, this action will also verify SHA256 checksums for downloaded files in all tools installed from GitHub Releases. This is enabled by default and can be disabled by setting the `checksum` input option to `false`.
Additionally, we also verify signature if the tool distributes signed archives. Signature verification is done at the stage of getting the checksum, so disabling the checksum will also disable signature verification.
2022-12-24 21:49:18 +09:00
See the linked documentation for information on security when installed using [snap](https://snapcraft.io/docs) or [cargo-binstall](https://github.com/cargo-bins/cargo-binstall#faq).
2021-12-30 17:33:20 +09:00
See the [Supported tools section](#supported-tools) for how to ensure that fallback is not used.
2022-12-14 11:47:44 +09:00
## Compatibility
This action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows) and containers (Ubuntu, Debian, Fedora, CentOS, Alma, openSUSE, Arch, Alpine).
2023-01-16 23:03:45 +09:00
To use this action in self-hosted runners or in containers, at least the following tools are required:
2022-12-14 11:47:44 +09:00
- bash
2021-12-30 17:33:20 +09:00
## Related Projects
- [cache-cargo-install-action]: GitHub Action for `cargo install` with cache.
2021-12-30 17:33:20 +09:00
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
- [upload-rust-binary-action]: GitHub Action for building and uploading Rust binary to GitHub Releases.
2022-06-10 23:39:53 +09:00
- [setup-cross-toolchain-action]: GitHub Action for setup toolchains for cross compilation and cross testing for Rust.
2021-12-30 17:33:20 +09:00
[cache-cargo-install-action]: https://github.com/taiki-e/cache-cargo-install-action
2022-08-09 05:09:08 +09:00
[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall
2021-12-30 17:33:20 +09:00
[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action
2022-06-10 23:39:53 +09:00
[setup-cross-toolchain-action]: https://github.com/taiki-e/setup-cross-toolchain-action
2021-12-30 17:33:20 +09:00
[upload-rust-binary-action]: https://github.com/taiki-e/upload-rust-binary-action
## License
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.
2024-03-02 17:49:14 +09:00
Each of the tools installed by this action has a different license. See the
[Supported tools](#supported-tools) section for more information.
2021-12-30 17:33:20 +09:00
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.