mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-02 03:10:28 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a86d24f499 | ||
|
|
c13274e43a | ||
|
|
b0d750a59e | ||
|
|
7d5481ab3a | ||
|
|
b6afd8d427 | ||
|
|
d1839c2f68 | ||
|
|
85064bbc1c | ||
|
|
9fdefab8ca | ||
|
|
c430b7f8ce | ||
|
|
cfca345a65 | ||
|
|
a76dc5ad72 | ||
|
|
1dda3d1d7e | ||
|
|
92705122ed |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
# Note: Specifying the version of valgrind and wasm-pack is not supported.
|
||||
# cargo-watch is supported by cargo-binstall (through quickinstall)
|
||||
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
||||
- cargo-hack@0.5.15,cargo-llvm-cov@0.4.11,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cross@0.2.4,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.1,wasmtime@0.39.1,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1
|
||||
- cargo-hack@0.5.16,cargo-llvm-cov@0.4.12,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cross@0.2.4,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.1,wasmtime@0.39.1,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1
|
||||
# Nextest supports basic version ranges as well
|
||||
- nextest@0.9
|
||||
include:
|
||||
|
||||
22
CHANGELOG.md
22
CHANGELOG.md
@@ -10,6 +10,23 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.8.2] - 2022-07-30
|
||||
|
||||
- Update `cargo-hack@latest` to 0.5.16.
|
||||
- Update `cargo-llvm-cov@latest` to 0.4.12.
|
||||
|
||||
## [1.8.1] - 2022-07-26
|
||||
|
||||
- Fix cargo-binstall installation failure.
|
||||
|
||||
## [1.8.0] - 2022-07-26
|
||||
|
||||
- Only use musl binaries for nextest if glibc isn't available. See [#13](https://github.com/taiki-e/install-action/issues/13) for more.
|
||||
|
||||
- Fix cargo-binstall installation failure. ([#16](https://github.com/taiki-e/install-action/pull/16), thanks @CAD97)
|
||||
|
||||
- Accept `cargo-nextest` as an alias for `nextest`. ([#15](https://github.com/taiki-e/install-action/pull/15), thanks @CAD97)
|
||||
|
||||
## [1.7.0] - 2022-07-25
|
||||
|
||||
- Install Rust-related binaries to `/usr/local/bin` when `$CARGO_HOME/bin` and `$HOME/.cargo/bin` is not available.
|
||||
@@ -226,7 +243,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.7.0...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.8.2...HEAD
|
||||
[1.8.2]: https://github.com/taiki-e/install-action/compare/v1.8.1...v1.8.2
|
||||
[1.8.1]: https://github.com/taiki-e/install-action/compare/v1.8.0...v1.8.1
|
||||
[1.8.0]: https://github.com/taiki-e/install-action/compare/v1.7.0...v1.8.0
|
||||
[1.7.0]: https://github.com/taiki-e/install-action/compare/v1.6.1...v1.7.0
|
||||
[1.6.1]: https://github.com/taiki-e/install-action/compare/v1.6.0...v1.6.1
|
||||
[1.6.0]: https://github.com/taiki-e/install-action/compare/v1.5.11...v1.6.0
|
||||
|
||||
@@ -39,7 +39,7 @@ To install a specific version, use `@version` syntax:
|
||||
```yaml
|
||||
- uses: taiki-e/install-action@v1
|
||||
with:
|
||||
tool: cargo-hack@0.5.15
|
||||
tool: cargo-hack@0.5.16
|
||||
```
|
||||
|
||||
To install multiple tools:
|
||||
@@ -71,7 +71,7 @@ https://spdx.org/licenses
|
||||
| [**cargo-minimal-versions**](https://github.com/taiki-e/cargo-minimal-versions) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-minimal-versions/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-minimal-versions/blob/HEAD/LICENSE-MIT) |
|
||||
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/HEAD/LICENSE-MIT) |
|
||||
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/cross-rs/cross/blob/HEAD/LICENSE-MIT) |
|
||||
| [**nextest**](https://github.com/nextest-rs/nextest) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) |
|
||||
| [**nextest**](https://github.com/nextest-rs/nextest) (alias: `cargo-nextest`) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) |
|
||||
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) |
|
||||
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS | [BSD-3-Clause](https://github.com/mvdan/sh/blob/HEAD/LICENSE) |
|
||||
| [**valgrind**](https://valgrind.org) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0-or-later](https://valgrind.org/docs/manual/license.gpl.html) |
|
||||
|
||||
32
main.sh
32
main.sh
@@ -63,13 +63,18 @@ download() {
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
||||
| tar "${tar_args[@]}" -C "${bin_dir}" "${bin}"
|
||||
}
|
||||
host_triple() {
|
||||
if [[ -z "${host:-}" ]]; then
|
||||
host="$(rustc -vV | grep host | cut -c 7-)"
|
||||
fi
|
||||
}
|
||||
install_cargo_binstall() {
|
||||
if [[ ! -f "${cargo_bin}/cargo-binstall" ]]; then
|
||||
info "installing cargo-binstall"
|
||||
|
||||
target="$(rustc -vV | grep host | cut -c 7-)"
|
||||
host_triple
|
||||
base_url=https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall
|
||||
case "${target}" in
|
||||
case "${host}" in
|
||||
x86_64-unknown-linux-gnu) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
|
||||
x86_64-unknown-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
|
||||
|
||||
@@ -82,13 +87,15 @@ install_cargo_binstall() {
|
||||
x86_64-pc-windows-gnu) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
||||
|
||||
x86_64-apple-darwin | aarch64-apple-darwin | x86_64-pc-windows-msvc)
|
||||
url="${base_url}-${target}.zip"
|
||||
url="${base_url}-${host}.zip"
|
||||
;;
|
||||
|
||||
*) bail "unsupported target '${target}' for cargo-binstall" ;;
|
||||
*) bail "unsupported target '${host}' for cargo-binstall" ;;
|
||||
esac
|
||||
|
||||
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
|
||||
info "cargo-binstall installed at $(type -P "cargo-binstall${exe}")"
|
||||
x cargo binstall --help | head -1 # cargo binstall doesn't have a normal --version flag
|
||||
else
|
||||
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall"
|
||||
fi
|
||||
@@ -146,9 +153,9 @@ for tool in "${tools[@]}"; do
|
||||
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
|
||||
case "${tool}" in
|
||||
# https://github.com/taiki-e/cargo-hack/releases
|
||||
cargo-hack) latest_version="0.5.15" ;;
|
||||
cargo-hack) latest_version="0.5.16" ;;
|
||||
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
||||
cargo-llvm-cov) latest_version="0.4.11" ;;
|
||||
cargo-llvm-cov) latest_version="0.4.12" ;;
|
||||
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
||||
cargo-minimal-versions) latest_version="0.1.5" ;;
|
||||
# https://github.com/taiki-e/parse-changelog/releases
|
||||
@@ -187,14 +194,14 @@ for tool in "${tools[@]}"; do
|
||||
esac
|
||||
download "${url}" "${cargo_bin}" "${tool}${exe}"
|
||||
;;
|
||||
nextest)
|
||||
nextest | cargo-nextest)
|
||||
bin="cargo-nextest"
|
||||
# https://nexte.st/book/pre-built-binaries.html
|
||||
case "${OSTYPE}" in
|
||||
linux*)
|
||||
# musl binaries are available on 0.9.29+.
|
||||
case "${version}" in
|
||||
0.[1-8].* | 0.9.[0-9] | 0.9.[0-1][0-9] | 0.9.2[0-8]) url="https://get.nexte.st/${version}/linux" ;;
|
||||
host_triple
|
||||
case "${host}" in
|
||||
*-linux-gnu*) url="https://get.nexte.st/${version}/linux" ;;
|
||||
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
||||
esac
|
||||
;;
|
||||
@@ -339,7 +346,10 @@ for tool in "${tools[@]}"; do
|
||||
linux* | darwin*) chmod +x "${cargo_bin}/${tool}${exe}" ;;
|
||||
esac
|
||||
;;
|
||||
cargo-binstall) install_cargo_binstall ;;
|
||||
cargo-binstall)
|
||||
install_cargo_binstall
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
cargo_binstall "${tool}" "${version}"
|
||||
continue
|
||||
|
||||
@@ -83,6 +83,7 @@ tools=(
|
||||
parse-changelog
|
||||
cross
|
||||
nextest
|
||||
cargo-nextest
|
||||
shellcheck
|
||||
shfmt
|
||||
valgrind
|
||||
|
||||
Reference in New Issue
Block a user