diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ae0ef85..56707a43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,19 +27,19 @@ 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.17,cargo-llvm-cov@0.4.14,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.30,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 # 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 + tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a5f8c20..e22bc0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] - Update `cargo-hack@latest` to 0.5.17. +- Support `cargo-udeps`. ## [1.10.4] - 2022-08-06 diff --git a/README.md b/README.md index a3a2d09a..13e97e14 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ 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/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) | diff --git a/main.sh b/main.sh index 7fc290b1..8b25899e 100755 --- a/main.sh +++ b/main.sh @@ -185,6 +185,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.30" + 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" @@ -431,6 +457,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 diff --git a/tools/publish.sh b/tools/publish.sh index 9a4ccc0c..11ac0816 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -80,6 +80,7 @@ tools=( cargo-hack cargo-llvm-cov cargo-minimal-versions + cargo-udeps parse-changelog cargo-binstall cross