mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-01 03:00:26 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5692c4095a | ||
|
|
afd84994bb | ||
|
|
b45f49a51d | ||
|
|
01c3792929 | ||
|
|
401ee5db19 | ||
|
|
6801bd56b9 | ||
|
|
ad25912b73 | ||
|
|
cc5a5c56a2 | ||
|
|
d85ed71ccb |
1
.github/.cspell/project-dictionary.txt
vendored
1
.github/.cspell/project-dictionary.txt
vendored
@@ -22,4 +22,5 @@ syft
|
||||
udeps
|
||||
wasmtime
|
||||
watchexec
|
||||
xbuild
|
||||
xscale
|
||||
|
||||
21
CHANGELOG.md
21
CHANGELOG.md
@@ -10,6 +10,22 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.18.0] - 2023-09-04
|
||||
|
||||
- Support `xbuild`. ([#212](https://github.com/taiki-e/install-action/pull/212), thanks @notgull)
|
||||
|
||||
- Update `cargo-hack@latest` to 0.6.5.
|
||||
|
||||
- Update `cargo-deny@latest` to 0.14.2.
|
||||
|
||||
## [2.17.8] - 2023-09-01
|
||||
|
||||
- Update `syft@latest` to 0.89.0.
|
||||
|
||||
## [2.17.7] - 2023-08-29
|
||||
|
||||
- Update `cargo-hack@latest` to 0.6.4.
|
||||
|
||||
## [2.17.6] - 2023-08-28
|
||||
|
||||
- Update `cargo-no-dev-deps@latest` to 0.2.4.
|
||||
@@ -1149,7 +1165,10 @@ Note: This release is considered a breaking change because installing on version
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.17.6...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.18.0...HEAD
|
||||
[2.18.0]: https://github.com/taiki-e/install-action/compare/v2.17.8...v2.18.0
|
||||
[2.17.8]: https://github.com/taiki-e/install-action/compare/v2.17.7...v2.17.8
|
||||
[2.17.7]: https://github.com/taiki-e/install-action/compare/v2.17.6...v2.17.7
|
||||
[2.17.6]: https://github.com/taiki-e/install-action/compare/v2.17.5...v2.17.6
|
||||
[2.17.5]: https://github.com/taiki-e/install-action/compare/v2.17.4...v2.17.5
|
||||
[2.17.4]: https://github.com/taiki-e/install-action/compare/v2.17.3...v2.17.4
|
||||
|
||||
@@ -109,6 +109,7 @@ https://spdx.org/licenses
|
||||
| [**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) |
|
||||
| [**wasm-pack**](https://github.com/rustwasm/wasm-pack) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustwasm/wasm-pack/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/rustwasm/wasm-pack/blob/HEAD/LICENSE-MIT) |
|
||||
| [**wasmtime**](https://github.com/bytecodealliance/wasmtime) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/bytecodealliance/wasmtime/releases) | Linux, macOS, Windows | [Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/HEAD/LICENSE) |
|
||||
| [**xbuild**](https://github.com/rust-mobile/xbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-mobile/xbuild/releases) | Linux, macOS, Windows | Apache-2.0 OR MIT |
|
||||
| [**zola**](https://github.com/getzola/zola) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/getzola/zola/releases) | Linux, macOS, Windows | [MIT](https://github.com/getzola/zola/blob/HEAD/LICENSE) |
|
||||
|
||||
If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
||||
|
||||
28
main.sh
28
main.sh
@@ -3,7 +3,7 @@
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
x() {
|
||||
rx() {
|
||||
local cmd="$1"
|
||||
shift
|
||||
(
|
||||
@@ -69,7 +69,12 @@ download_and_extract() {
|
||||
fi
|
||||
fi
|
||||
local installed_bin
|
||||
installed_bin="${bin_dir}/$(basename "${bin_in_archive}")"
|
||||
|
||||
# xbuild's binary name is "x", as opposed to the usual crate name
|
||||
case "${tool}" in
|
||||
xbuild) installed_bin="${bin_dir}/x" ;;
|
||||
*) installed_bin="${bin_dir}/$(basename "${bin_in_archive}")" ;;
|
||||
esac
|
||||
|
||||
local tar_args=()
|
||||
case "${url}" in
|
||||
@@ -246,7 +251,7 @@ install_cargo_binstall() {
|
||||
info "installing cargo-binstall"
|
||||
download_from_manifest "cargo-binstall" "latest"
|
||||
info "cargo-binstall installed at $(type -P "cargo-binstall${exe}")"
|
||||
x cargo binstall -V
|
||||
rx cargo binstall -V
|
||||
fi
|
||||
}
|
||||
apt_update() {
|
||||
@@ -578,27 +583,28 @@ for tool in "${tools[@]}"; do
|
||||
cargo-*)
|
||||
if type -P cargo &>/dev/null; then
|
||||
case "${tool}" in
|
||||
cargo-valgrind) x cargo "${tool#cargo-}" --help ;; # cargo-valgrind 2.1.0's --version option just calls cargo's --version option
|
||||
cargo-valgrind) rx cargo "${tool#cargo-}" --help ;; # cargo-valgrind 2.1.0's --version option just calls cargo's --version option
|
||||
*)
|
||||
if ! x cargo "${tool#cargo-}" --version; then
|
||||
x cargo "${tool#cargo-}" --help
|
||||
if ! rx cargo "${tool#cargo-}" --version; then
|
||||
rx cargo "${tool#cargo-}" --help
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
case "${tool}" in
|
||||
cargo-valgrind) x "${tool}" "${tool#cargo-}" --help ;; # cargo-valgrind 2.1.0's --version option just calls cargo's --version option
|
||||
cargo-valgrind) rx "${tool}" "${tool#cargo-}" --help ;; # cargo-valgrind 2.1.0's --version option just calls cargo's --version option
|
||||
*)
|
||||
if ! x "${tool}" "${tool#cargo-}" --version; then
|
||||
x "${tool}" "${tool#cargo-}" --help
|
||||
if ! rx "${tool}" "${tool#cargo-}" --version; then
|
||||
rx "${tool}" "${tool#cargo-}" --help
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
xbuild) rx "x" --version ;;
|
||||
*)
|
||||
if ! x "${tool}" --version; then
|
||||
x "${tool}" --help
|
||||
if ! rx "${tool}" --version; then
|
||||
rx "${tool}" --help
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
18
manifests/cargo-deny.json
generated
18
manifests/cargo-deny.json
generated
@@ -19,10 +19,24 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.14.1"
|
||||
"version": "0.14.2"
|
||||
},
|
||||
"0.14": {
|
||||
"version": "0.14.1"
|
||||
"version": "0.14.2"
|
||||
},
|
||||
"0.14.2": {
|
||||
"x86_64_linux_musl": {
|
||||
"checksum": "5a4913ae3ce1298bd96d29b794ed245b0394f5ec0e2802f19d41fedc70bb5c3c"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "89c80839cfbb87bb8b0e4a1d55d638b79d0d9cac8fa53c0cbbe8fe271c8abcf4"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "25e59c4916a4e28d507185c6783051d0e0824d6e5af5737560be7bcfb1fc7af3"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "c1af65dac2330777744513430200d52cb615de9bef2fdb88cfec1a2e9f87c5f9"
|
||||
}
|
||||
},
|
||||
"0.14.1": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
56
manifests/cargo-hack.json
generated
56
manifests/cargo-hack.json
generated
@@ -2,10 +2,62 @@
|
||||
"rust_crate": "cargo-hack",
|
||||
"template": null,
|
||||
"latest": {
|
||||
"version": "0.6.3"
|
||||
"version": "0.6.5"
|
||||
},
|
||||
"0.6": {
|
||||
"version": "0.6.3"
|
||||
"version": "0.6.5"
|
||||
},
|
||||
"0.6.5": {
|
||||
"x86_64_linux_musl": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-x86_64-unknown-linux-musl.tar.gz",
|
||||
"checksum": "767c91d80cacf9568576d9263b8801d4c38a245c472ac3c58320b15824539a74"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-x86_64-apple-darwin.tar.gz",
|
||||
"checksum": "20530649af2bfa2620368b6a111e5538f9306c4f64a65a1e6dbbb32a7a291b8a"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-x86_64-pc-windows-msvc.zip",
|
||||
"checksum": "82731808c811daa55021e8a463884c3d1fa3ff4af67fdfd1b0f8db9936ec91df"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-aarch64-unknown-linux-musl.tar.gz",
|
||||
"checksum": "743fe76f2115bedf6f5a86784ea254c105f171aeeb75e5f2845d6aa83be7319c"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-aarch64-apple-darwin.tar.gz",
|
||||
"checksum": "3a9ab29db73449b779656199ae645d7b4a3e055e22ee6fa056c7ec61cd57cb87"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.5/cargo-hack-aarch64-pc-windows-msvc.tar.gz",
|
||||
"checksum": "2bf9b10a41ce7585fa60b1be8424283433eb000c542652145d89d95be7a6fc99"
|
||||
}
|
||||
},
|
||||
"0.6.4": {
|
||||
"x86_64_linux_musl": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-x86_64-unknown-linux-musl.tar.gz",
|
||||
"checksum": "f50d28b566a270c49cd5d44fca3badfc0279bd681e9788872c875f81f2125ca0"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-x86_64-apple-darwin.tar.gz",
|
||||
"checksum": "09502a5e1e66457cc98f114e3ab80ace837c42ca20d12439b45ca09febeada05"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-x86_64-pc-windows-msvc.zip",
|
||||
"checksum": "5e5f61e74ae060b5ff1aeb0ee593a63762ad5e57fe9fbd56d214af96e8b79db6"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-aarch64-unknown-linux-musl.tar.gz",
|
||||
"checksum": "0b3cf069d1e433882f800129b288e76f8b0f4972e2f5d2746a43f5976b3f234d"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-aarch64-apple-darwin.tar.gz",
|
||||
"checksum": "01e237e764b098d1a482e4fc31c2aa1a64d6756e885421a95faa5578cfdd2a50"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"url": "https://github.com/taiki-e/cargo-hack/releases/download/v0.6.4/cargo-hack-aarch64-pc-windows-msvc.tar.gz",
|
||||
"checksum": "af68ead95d98a18750da188259678ce53f8cecae8fb7109ae0c631161da8406e"
|
||||
}
|
||||
},
|
||||
"0.6.3": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
22
manifests/syft.json
generated
22
manifests/syft.json
generated
@@ -23,7 +23,27 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.88.0"
|
||||
"version": "0.89.0"
|
||||
},
|
||||
"0.89": {
|
||||
"version": "0.89.0"
|
||||
},
|
||||
"0.89.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"checksum": "b7cc7c1fb588454947ca678df7ddd906620d399a05f92a550b1b2d312fb26764"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "fd8fc86772d44b4a93f6566a897f832923cc6aa3de9434772a4ac0966377f8be"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "1a512c97b3fa504ad0b6c8c62660cfe980786a433a1582b460bd35005b36ceb2"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"checksum": "1c1c8e53d7157c3e861116e24eb494da0b660b3757ea69d6e05038c6ed76c50f"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "7d6d848c4375d10c2ebd019120a835f3d4527bb78250efc47fd2ba010a6798ba"
|
||||
}
|
||||
},
|
||||
"0.88": {
|
||||
"version": "0.88.0"
|
||||
|
||||
34
manifests/xbuild.json
generated
Normal file
34
manifests/xbuild.json
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"rust_crate": "xbuild",
|
||||
"template": {
|
||||
"x86_64_linux_gnu": {
|
||||
"url": "https://github.com/rust-mobile/xbuild/releases/download/v${version}/xbuild-linux-x64",
|
||||
"bin": "xbuild-linux-x64"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/rust-mobile/xbuild/releases/download/v${version}/xbuild-macos-x64",
|
||||
"bin": "xbuild-macos-x64"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/rust-mobile/xbuild/releases/download/v${version}/xbuild-windows-x64.exe",
|
||||
"bin": "xbuild-windows-x64.exe"
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.2.0"
|
||||
},
|
||||
"0.2": {
|
||||
"version": "0.2.0"
|
||||
},
|
||||
"0.2.0": {
|
||||
"x86_64_linux_gnu": {
|
||||
"checksum": "9c294809ec3cb314b34e9f644b5bbf6ed262c25c1eeb78a3691836a95bc58e0d"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "e357205fde5262d77b8b1dc1cb066a4f7b4edd0a83b71b3513ae466b08343305"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "ce503cd64e6449d1c3e3bc2bfb621e9dd3ebfc775e99c97f98c2ab145e533946"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,11 @@ IFS=$'\n\t'
|
||||
cd "$(dirname "$0")"/../..
|
||||
|
||||
# They don't provide prebuilt binaries for musl or old glibc host.
|
||||
glibc_pre_2_34_incompat=(
|
||||
xbuild
|
||||
)
|
||||
glibc_pre_2_31_incompat=(
|
||||
"${glibc_pre_2_34_incompat[@]}"
|
||||
zola
|
||||
)
|
||||
glibc_pre_2_27_incompat=(
|
||||
@@ -41,13 +45,18 @@ case "$(uname -s)" in
|
||||
incompat_tools+=("${musl_incompat[@]}")
|
||||
else
|
||||
host_glibc_version=$(grep <<<"${ldd_version}" -E "GLIBC|GNU libc" | sed "s/.* //g")
|
||||
higher_glibc_version=$(sort <<<"2.31"$'\n'"${host_glibc_version}" -Vu | tail -1)
|
||||
higher_glibc_version=$(sort <<<"2.34"$'\n'"${host_glibc_version}" -Vu | tail -1)
|
||||
if [[ "${higher_glibc_version}" != "${host_glibc_version}" ]]; then
|
||||
higher_glibc_version=$(sort <<<"2.27"$'\n'"${host_glibc_version}" -Vu | tail -1)
|
||||
if [[ "${higher_glibc_version}" == "${host_glibc_version}" ]]; then
|
||||
incompat_tools+=("${glibc_pre_2_31_incompat[@]}")
|
||||
higher_glibc_version=$(sort <<<"2.31"$'\n'"${host_glibc_version}" -Vu | tail -1)
|
||||
if [[ "${higher_glibc_version}" != "${host_glibc_version}" ]]; then
|
||||
higher_glibc_version=$(sort <<<"2.27"$'\n'"${host_glibc_version}" -Vu | tail -1)
|
||||
if [[ "${higher_glibc_version}" == "${host_glibc_version}" ]]; then
|
||||
incompat_tools+=("${glibc_pre_2_31_incompat[@]}")
|
||||
else
|
||||
incompat_tools+=("${glibc_pre_2_27_incompat[@]}")
|
||||
fi
|
||||
else
|
||||
incompat_tools+=("${glibc_pre_2_27_incompat[@]}")
|
||||
incompat_tools+=("${glibc_pre_2_34_incompat[@]}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
13
tools/codegen/base/xbuild.json
Normal file
13
tools/codegen/base/xbuild.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"repository": "https://github.com/rust-mobile/xbuild",
|
||||
"tag_prefix": "v",
|
||||
"rust_crate": "${package}",
|
||||
"asset_name": "${package}-${os_name}-x64${exe}",
|
||||
"bin": "${package}-${os_name}-x64${exe}",
|
||||
"version_range": ">= 0.2.0",
|
||||
"platform": {
|
||||
"x86_64_linux_gnu": {},
|
||||
"x86_64_macos": {},
|
||||
"x86_64_windows": {}
|
||||
}
|
||||
}
|
||||
@@ -178,6 +178,12 @@ fn main() -> Result<()> {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Specifically skip versions of xbuild with build metadata.
|
||||
if base_info.rust_crate.as_deref() == Some("xbuild") && !semver_version.build.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut download_info = BTreeMap::new();
|
||||
for (&platform, base_download_info) in &base_info.platform {
|
||||
let asset_names = base_download_info
|
||||
|
||||
Reference in New Issue
Block a user