Compare commits

...

14 Commits

Author SHA1 Message Date
Taiki Endo
581b570b73 Release 1.11.2 2022-08-23 21:38:29 +09:00
Taiki Endo
57339998f1 Update wasmtime, cargo-udeps, and protoc 2022-08-23 21:29:55 +09:00
Taiki Endo
dda69eeab2 Remove uses of GitHub-hosted ubuntu-18.04 runner
Refs: https://github.com/actions/runner-images/issues/6002
2022-08-22 22:14:46 +09:00
Taiki Endo
3f4a57923d Add .shellcheckrc 2022-08-22 21:50:17 +09:00
Taiki Endo
cb1e26fae1 Enable dependabot update for Github Actions 2022-08-20 21:38:18 +09:00
Taiki Endo
74efbe3ca4 Release 1.11.1 2022-08-13 16:16:46 +09:00
Taiki Endo
0ed66b7383 Update changelog 2022-08-13 16:14:20 +09:00
Jiahao XU
b9424a9dfb Cargo binstall force (#19)
* Upgrade `cargo-binstall` if already installed
* Use `--force` for `cargo-binstall` in case bin is not cached

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-13 16:02:28 +09:00
Taiki Endo
0b2484c3a0 Release 1.11.0 2022-08-13 14:40:02 +09:00
NAKASHIMA, Makoto
bd71caf797 Support cargo-udeps (#17) 2022-08-13 14:37:57 +09:00
Taiki Endo
4696ae1646 Update cargo-hack to 0.5.17 2022-08-13 06:16:32 +09:00
Taiki Endo
a1eacca287 Update cargo-binstall URL 2022-08-09 05:09:08 +09:00
Taiki Endo
c25592b07d Release 1.10.4 2022-08-07 02:15:58 +09:00
Taiki Endo
61afdb8d12 Update cargo-llvm-cov to 0.4.14 2022-08-07 01:51:36 +09:00
7 changed files with 95 additions and 23 deletions

9
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: ''
labels: []

View File

@@ -27,19 +27,15 @@ jobs:
tool:
# Note: Specifying the version of valgrind is not supported.
# cargo-watch is supported by cargo-binstall (through quickinstall)
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- cargo-hack@0.5.16,cargo-llvm-cov@0.4.13,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cross@0.2.4,nextest@0.9.11,protoc@3.21.4,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@0.39.1,mdbook@0.4.21,mdbook-linkcheck@0.7.6,cargo-watch@8.1.1
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- cargo-hack@0.5.17,cargo-llvm-cov@0.4.14,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cargo-udeps@0.1.32,cross@0.2.4,nextest@0.9.11,protoc@3.21.5,shellcheck@0.8.0,shfmt@3.5.1,wasm-pack@0.10.3,wasmtime@0.40.0,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:
# Note: mdBook binary is incompatible with ubuntu 18.04,
# see https://github.com/rust-lang/mdBook/issues/1779
- os: ubuntu-18.04
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook-linkcheck,cargo-watch
- os: macos-11
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- os: windows-2019
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

14
.shellcheckrc Normal file
View File

@@ -0,0 +1,14 @@
# ShellCheck configuration
# https://github.com/koalaman/shellcheck/blob/HEAD/shellcheck.1.md#rc-files
# See also:
# https://www.shellcheck.net/wiki/Optional
# https://google.github.io/styleguide/shellguide.html
# https://www.shellcheck.net/wiki/SC2292
# https://google.github.io/styleguide/shellguide.html#s6.3-tests
enable=require-double-brackets
# https://www.shellcheck.net/wiki/SC2250
# https://google.github.io/styleguide/shellguide.html#s5.6-variable-expansion
enable=require-variable-braces

View File

@@ -10,6 +10,25 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [1.11.2] - 2022-08-23
- Update `wasmtime@latest` to 0.40.0.
- Update `cargo-udeps@latest` to 0.1.32.
- Update `protoc@latest` to 3.21.5.
## [1.11.1] - 2022-08-13
- Make installation that uses `cargo-binstall` robust. ([#19](https://github.com/taiki-e/install-action/pull/19), thanks @NobodyXu)
## [1.11.0] - 2022-08-13
- Update `cargo-hack@latest` to 0.5.17.
- Support `cargo-udeps`. ([#17](https://github.com/taiki-e/install-action/pull/17), thanks @gifnksm)
## [1.10.4] - 2022-08-06
- Update `cargo-llvm-cov@latest` to 0.4.14.
## [1.10.3] - 2022-08-01
- Support `wasm-pack` on Windows.
@@ -277,7 +296,11 @@ 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.10.3...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.11.2...HEAD
[1.11.2]: https://github.com/taiki-e/install-action/compare/v1.11.1...v1.11.2
[1.11.1]: https://github.com/taiki-e/install-action/compare/v1.11.0...v1.11.1
[1.11.0]: https://github.com/taiki-e/install-action/compare/v1.10.4...v1.11.0
[1.10.4]: https://github.com/taiki-e/install-action/compare/v1.10.3...v1.10.4
[1.10.3]: https://github.com/taiki-e/install-action/compare/v1.10.2...v1.10.3
[1.10.2]: https://github.com/taiki-e/install-action/compare/v1.10.1...v1.10.2
[1.10.1]: https://github.com/taiki-e/install-action/compare/v1.10.0...v1.10.1

View File

@@ -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.16
tool: cargo-hack@0.5.17
```
To install multiple tools:
@@ -69,11 +69,12 @@ https://spdx.org/licenses
| [**cargo-hack**](https://github.com/taiki-e/cargo-hack) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-hack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-hack/blob/HEAD/LICENSE-MIT) |
| [**cargo-llvm-cov**](https://github.com/taiki-e/cargo-llvm-cov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/cargo-llvm-cov/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/cargo-llvm-cov/blob/HEAD/LICENSE-MIT) |
| [**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) |
| [**cargo-udeps**](https://github.com/est31/cargo-udeps) | `$CARGO_HOME/bin` | [GitHub Release](https://github.com/est31/cargo-udeps/releases) | Linux, macOS, Windows | [Apache-2.0 OR MIT](https://github.com/est31/cargo-udeps/blob/master/LICENSE) |
| [**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) |
| [**cargo-binstall**][cargo-binstall] | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/ryankurte/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/ryankurte/cargo-binstall/blob/HEAD/LICENSE.txt) |
| [**cargo-binstall**][cargo-binstall] | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cargo-bins/cargo-binstall/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/LICENSE.txt) |
| [**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) |
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/HEAD/LICENSE) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/HEAD/LICENSE) |
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/HEAD/LICENSE) |
| [**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) |
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `/usr/local/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) |
@@ -104,7 +105,7 @@ If you want a higher level of security, consider working on [#1](https://github.
- [upload-rust-binary-action]: GitHub Action for building and uploading Rust binary to GitHub Releases.
- [setup-cross-toolchain-action]: GitHub Action for setup toolchains for cross compilation and cross testing for Rust.
[cargo-binstall]: https://github.com/ryankurte/cargo-binstall
[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall
[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action
[setup-cross-toolchain-action]: https://github.com/taiki-e/setup-cross-toolchain-action
[upload-rust-binary-action]: https://github.com/taiki-e/upload-rust-binary-action

48
main.sh
View File

@@ -83,7 +83,7 @@ install_cargo_binstall() {
info "installing cargo-binstall"
host_triple
base_url=https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall
base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall
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" ;;
@@ -105,9 +105,10 @@ install_cargo_binstall() {
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
x cargo binstall -V
else
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall"
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall, upgrading"
cargo binstall --secure --no-confirm --version '>=0.12.0' cargo-binstall
fi
}
cargo_binstall() {
@@ -122,8 +123,8 @@ cargo_binstall() {
# As a result, http will be disabled, and it will also set
# min tls version to be 1.2
case "${version}" in
latest) cargo binstall --secure --no-confirm "$tool" ;;
*) cargo binstall --secure --no-confirm --version "$version" "$tool" ;;
latest) cargo binstall --force --secure --no-confirm "${tool}" ;;
*) cargo binstall --force --secure --no-confirm --version "${version}" "${tool}" ;;
esac
}
@@ -145,7 +146,7 @@ case "${OSTYPE}" in
cygwin* | msys*) exe=".exe" ;;
esac
cargo_bin="${CARGO_HOME:-"$HOME/.cargo"}/bin"
cargo_bin="${CARGO_HOME:-"${HOME}/.cargo"}/bin"
if [[ ! -d "${cargo_bin}" ]]; then
cargo_bin=/usr/local/bin
fi
@@ -163,9 +164,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.16" ;;
cargo-hack) latest_version="0.5.17" ;;
# https://github.com/taiki-e/cargo-llvm-cov/releases
cargo-llvm-cov) latest_version="0.4.13" ;;
cargo-llvm-cov) latest_version="0.4.14" ;;
# 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
@@ -185,6 +186,32 @@ for tool in "${tools[@]}"; do
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
cargo-udeps)
# https://github.com/est31/cargo-udeps/releases
latest_version="0.1.32"
repo="est31/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
esac
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
case "${OSTYPE}" in
linux*)
target="x86_64-unknown-linux-gnu"
url="${base_url}-${target}.tar.gz"
;;
darwin*)
target="x86_64-apple-darwin"
url="${base_url}-${target}.tar.gz"
;;
cygwin* | msys*)
target="x86_64-pc-windows-msvc"
url="${base_url}-${target}.zip"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
# leading `./` is required for cargo-udeps to work
download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}"
;;
cross)
# https://github.com/cross-rs/cross/releases
latest_version="0.2.4"
@@ -225,7 +252,7 @@ for tool in "${tools[@]}"; do
;;
protoc)
# https://github.com/protocolbuffers/protobuf/releases
latest_version="3.21.4"
latest_version="3.21.5"
repo="protocolbuffers/protobuf"
case "${version}" in
latest) version="${latest_version}" ;;
@@ -361,7 +388,7 @@ for tool in "${tools[@]}"; do
;;
wasmtime)
# https://github.com/bytecodealliance/wasmtime/releases
latest_version="0.39.1"
latest_version="0.40.0"
repo="bytecodealliance/${tool}"
case "${version}" in
latest) version="${latest_version}" ;;
@@ -431,6 +458,7 @@ for tool in "${tools[@]}"; do
info "${tool} installed at $(type -P "${bin}")"
case "${bin}" in
"cargo-udeps${exe}") x cargo udeps --help | head -1 ;; # cargo-udeps v0.1.30 does not support --version option
cargo-*) x cargo "${tool#cargo-}" --version ;;
*) x "${tool}" --version ;;
esac

View File

@@ -80,6 +80,7 @@ tools=(
cargo-hack
cargo-llvm-cov
cargo-minimal-versions
cargo-udeps
parse-changelog
cargo-binstall
cross