mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-04 12:10:29 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fdefab8ca | ||
|
|
c430b7f8ce | ||
|
|
cfca345a65 | ||
|
|
a76dc5ad72 | ||
|
|
1dda3d1d7e | ||
|
|
92705122ed |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -10,6 +10,14 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [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 +234,8 @@ 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.0...HEAD
|
||||
[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
|
||||
|
||||
@@ -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) |
|
||||
|
||||
22
main.sh
22
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,10 +87,10 @@ 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}"
|
||||
@@ -187,14 +192,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
|
||||
;;
|
||||
@@ -348,6 +353,7 @@ for tool in "${tools[@]}"; do
|
||||
|
||||
info "${tool} installed at $(type -P "${bin}")"
|
||||
case "${bin}" in
|
||||
cargo-binstall) x cargo binstall | head 1 ;; # cargo binstall doesn't have a normal --version flag
|
||||
cargo-*) x cargo "${tool#cargo-}" --version ;;
|
||||
*) x "${tool}" --version ;;
|
||||
esac
|
||||
|
||||
@@ -83,6 +83,7 @@ tools=(
|
||||
parse-changelog
|
||||
cross
|
||||
nextest
|
||||
cargo-nextest
|
||||
shellcheck
|
||||
shfmt
|
||||
valgrind
|
||||
|
||||
Reference in New Issue
Block a user