mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-28 01:50:27 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a29ce630c | ||
|
|
acc0c0687d | ||
|
|
c98c0a5de9 | ||
|
|
b5a6a481a3 | ||
|
|
936bda0c55 | ||
|
|
e0abba697f | ||
|
|
320900e2b1 | ||
|
|
4ea8614f66 | ||
|
|
c4112353fe | ||
|
|
d14576d5ee | ||
|
|
54f239fc7f | ||
|
|
0c60ab7876 | ||
|
|
cb3ffa00b0 | ||
|
|
a68686a8a2 | ||
|
|
c5a36f2fba | ||
|
|
5e3287fe00 | ||
|
|
807aa14713 | ||
|
|
1ab447b34f | ||
|
|
d66f303732 | ||
|
|
59c6ff35e6 |
3
.github/.cspell/project-dictionary.txt
vendored
3
.github/.cspell/project-dictionary.txt
vendored
@@ -8,15 +8,18 @@ koalaman
|
||||
libc
|
||||
linkcheck
|
||||
mdbook
|
||||
microdnf
|
||||
mvdan
|
||||
nextest
|
||||
protobuf
|
||||
protoc
|
||||
protocolbuffers
|
||||
quickinstall
|
||||
rockylinux
|
||||
rustwasm
|
||||
shellcheck
|
||||
shfmt
|
||||
toolchains
|
||||
udeps
|
||||
wasmtime
|
||||
xscale
|
||||
|
||||
57
.github/workflows/ci.yml
vendored
57
.github/workflows/ci.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
include:
|
||||
# Note: Specifying the version of valgrind and cargo-binstall is not supported.
|
||||
- os: ubuntu-20.04
|
||||
tool: cargo-hack@0.5.24,cargo-llvm-cov@0.5.2,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.11,shellcheck@0.9.0,shfmt@3.6.0,wasm-pack@0.10.3,wasmtime@3.0.1,mdbook@0.4.22,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
|
||||
tool: cargo-hack@0.5.24,cargo-llvm-cov@0.5.3,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.12,shellcheck@0.9.0,shfmt@3.6.0,wasm-pack@0.10.3,wasmtime@4.0.0,mdbook@0.4.25,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
|
||||
# Nextest supports basic version ranges as well. For other tools, this will be supported by https://github.com/taiki-e/install-action/pull/27.
|
||||
- os: ubuntu-20.04
|
||||
tool: nextest@0.9
|
||||
@@ -56,34 +56,63 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
container:
|
||||
- ubuntu:20.04
|
||||
- debian:latest
|
||||
- ubuntu:18.04 # glibc 2.27
|
||||
- ubuntu:20.04 # glibc 2.31
|
||||
- debian:10-slim # glibc 2.28
|
||||
- debian:11-slim # glibc 2.31
|
||||
- rockylinux:8 # glibc 2.28
|
||||
- rockylinux:8-minimal # glibc 2.28
|
||||
tool:
|
||||
# valgrind: installing snap to container is difficult...
|
||||
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
||||
include:
|
||||
- container: ubuntu:18.04
|
||||
# The latest mdbook provides prebuilt binaries for musl host, but we don't support it yet (will be done by https://github.com/taiki-e/install-action/pull/27)
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook-linkcheck,cargo-watch
|
||||
- container: alpine:latest
|
||||
# cargo-udeps,protoc,valgrind,wasmtime,mdbook,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,shellcheck,shfmt,wasm-pack,cargo-binstall
|
||||
- container: ubuntu:22.04 # glibc 2.35
|
||||
# cargo-udeps depends on openssl 1.1
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
||||
- container: fedora:latest # glibc 2.36 (as of fedora 37)
|
||||
# cargo-udeps depends on openssl 1.1
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
||||
- container: centos:7 # glibc 2.17
|
||||
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
|
||||
# we don't support nextest on very old glibc due to https://github.com/taiki-e/install-action/issues/13.
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
|
||||
- container: alpine:latest # musl 1.2.3 (as of alpine 3.17)
|
||||
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install requirements (ubuntu/debian)
|
||||
run: |
|
||||
set -ex
|
||||
set -euxo pipefail
|
||||
apt-get -o Acquire::Retries=10 -qq update
|
||||
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo
|
||||
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
|
||||
- name: Install requirements (fedora/rockylinux)
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
dnf=dnf
|
||||
if ! type -P dnf &>/dev/null; then
|
||||
dnf=microdnf
|
||||
fi
|
||||
# tar and gzip are required for actions/checkout on rockylinux:*-minimal
|
||||
$dnf install -y cargo tar gzip
|
||||
if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'rockylinux')
|
||||
- name: Install requirements (centos)
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
||||
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}"
|
||||
if: startsWith(matrix.container, 'centos')
|
||||
- name: Install requirements (alpine)
|
||||
run: apk add bash cargo
|
||||
run: |
|
||||
set -eux
|
||||
apk add bash cargo
|
||||
shell: sh
|
||||
if: startsWith(matrix.container, 'alpine')
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ./
|
||||
with:
|
||||
tool: ${{ matrix.tool }}
|
||||
|
||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -10,6 +10,26 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.17.3] - 2022-12-22
|
||||
|
||||
- Update `wasmtime@latest` to 4.0.0.
|
||||
|
||||
## [1.17.2] - 2022-12-17
|
||||
|
||||
- Update `mdbook@latest` to 0.4.25.
|
||||
|
||||
## [1.17.1] - 2022-12-15
|
||||
|
||||
- Update `mdbook@latest` to 0.4.23.
|
||||
- Support `mdbook` on Linux (musl).
|
||||
- Update `cargo-llvm-cov@latest` to 0.5.3.
|
||||
|
||||
## [1.17.0] - 2022-12-14
|
||||
|
||||
- Update `protoc@latest` to 3.21.12.
|
||||
- Support aarch64 self-hosted runners (Linux, macOS, Windows).
|
||||
- Improve support for Fedora/RHEL based containers/self-hosted runners.
|
||||
|
||||
## [1.16.0] - 2022-12-14
|
||||
|
||||
- Update `cargo-binstall@latest` to 0.18.1. ([#32](https://github.com/taiki-e/install-action/pull/32), thanks @NobodyXu)
|
||||
@@ -18,7 +38,9 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
It is mainly intended to make the use of this action easy on containers or self-hosted runners, and currently supports Debian-based distributions (including Ubuntu) and Alpine.
|
||||
|
||||
The system's package manager is used for these installations. However, bash, which is an execution requirement of the action itself, and rustc, which is usually preferred for installation by rustup rather than the system's package manager, are *not* covered by these installations.
|
||||
The system's package manager is used for these installations. However, `bash`, which is an execution requirement of the action itself, and `cargo`, which is usually preferred for installation by rustup rather than the system's package manager, are *not* covered by these installations.
|
||||
|
||||
See also the [compatibility note in readme](https://github.com/taiki-e/install-action#compatibility).
|
||||
|
||||
## [1.15.5] - 2022-12-13
|
||||
|
||||
@@ -439,7 +461,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.16.0...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.17.3...HEAD
|
||||
[1.17.3]: https://github.com/taiki-e/install-action/compare/v1.17.2...v1.17.3
|
||||
[1.17.2]: https://github.com/taiki-e/install-action/compare/v1.17.1...v1.17.2
|
||||
[1.17.1]: https://github.com/taiki-e/install-action/compare/v1.17.0...v1.17.1
|
||||
[1.17.0]: https://github.com/taiki-e/install-action/compare/v1.16.0...v1.17.0
|
||||
[1.16.0]: https://github.com/taiki-e/install-action/compare/v1.15.5...v1.16.0
|
||||
[1.15.5]: https://github.com/taiki-e/install-action/compare/v1.15.4...v1.15.5
|
||||
[1.15.4]: https://github.com/taiki-e/install-action/compare/v1.15.3...v1.15.4
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# install-action
|
||||
|
||||
[](https://github.com/taiki-e/install-action/actions)
|
||||
[](https://github.com/taiki-e/install-action/actions)
|
||||
|
||||
GitHub Action for installing development tools (mainly from GitHub Releases).
|
||||
|
||||
@@ -104,11 +104,11 @@ If you want a higher level of security, consider working on [#1](https://github.
|
||||
|
||||
## Compatibility
|
||||
|
||||
This action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows) and containers (Ubuntu, Debian, Alpine).
|
||||
This action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows) and containers (Ubuntu, Debian, Alpine, Fedora, CentOS, Rocky).
|
||||
To use this action in self-hosted runners or in containers, you will need to install at least the following:
|
||||
|
||||
- bash
|
||||
- cargo (if you install cargo subcommands)
|
||||
- cargo (if you install cargo subcommands or use cargo-binstall fallback)
|
||||
|
||||
## Related Projects
|
||||
|
||||
|
||||
143
main.sh
143
main.sh
@@ -51,7 +51,7 @@ download() {
|
||||
tar_args+=("xjf")
|
||||
if ! type -P bzip2 &>/dev/null; then
|
||||
case "${base_distro}" in
|
||||
debian | alpine) sys_install bzip2 ;;
|
||||
debian | alpine | fedora) sys_install bzip2 ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
@@ -60,21 +60,21 @@ download() {
|
||||
if ! type -P xz &>/dev/null; then
|
||||
case "${base_distro}" in
|
||||
debian) sys_install xz-utils ;;
|
||||
alpine) sys_install xz ;;
|
||||
alpine | fedora) sys_install xz ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
*.zip)
|
||||
if ! type -P unzip &>/dev/null; then
|
||||
case "${base_distro}" in
|
||||
debian | alpine) sys_install unzip ;;
|
||||
debian | alpine | fedora) sys_install unzip ;;
|
||||
esac
|
||||
fi
|
||||
mkdir -p .install-action-tmp
|
||||
(
|
||||
cd .install-action-tmp
|
||||
info "downloading ${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" -o tmp.zip
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
|
||||
unzip tmp.zip
|
||||
mv "${bin}" "${bin_dir}/"
|
||||
)
|
||||
@@ -90,14 +90,9 @@ download() {
|
||||
tar_args+=(--strip-components "${components}")
|
||||
fi
|
||||
info "downloading ${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${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() {
|
||||
# https://github.com/cargo-bins/cargo-binstall/releases
|
||||
local binstall_version="0.18.1"
|
||||
@@ -115,15 +110,12 @@ install_cargo_binstall() {
|
||||
if [[ -n "${install_binstall}" ]]; then
|
||||
info "installing cargo-binstall"
|
||||
|
||||
host_triple
|
||||
base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/v${binstall_version}/cargo-binstall"
|
||||
case "${host}" in
|
||||
x86_64-*-linux-gnu | x86_64-*-linux-musl) url="${base_url}-x86_64-unknown-linux-musl.tgz" ;;
|
||||
armv7-*-linux-gnueabihf | armv7-*-linux-musleabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
|
||||
aarch64-*-linux-gnu | aarch64-*-linux-musl) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
|
||||
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}-${host}.zip" ;;
|
||||
*) bail "unsupported target '${host}' for cargo-binstall" ;;
|
||||
case "${OSTYPE}" in
|
||||
linux*) url="${base_url}-${host_arch}-unknown-linux-musl.tgz" ;;
|
||||
darwin*) url="${base_url}-${host_arch}-apple-darwin.zip" ;;
|
||||
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for cargo-binstall" ;;
|
||||
esac
|
||||
|
||||
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
|
||||
@@ -186,10 +178,18 @@ apk_install() {
|
||||
apk add "$@"
|
||||
fi
|
||||
}
|
||||
dnf_install() {
|
||||
if type -P sudo &>/dev/null; then
|
||||
retry sudo "${dnf}" install -y "$@"
|
||||
else
|
||||
retry "${dnf}" install -y "$@"
|
||||
fi
|
||||
}
|
||||
sys_install() {
|
||||
case "${base_distro}" in
|
||||
debian) apt_install "$@" ;;
|
||||
alpine) apk_install "$@" ;;
|
||||
fedora) dnf_install "$@" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -206,20 +206,59 @@ if [[ -n "${tool}" ]]; then
|
||||
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
|
||||
fi
|
||||
|
||||
# Refs: https://github.com/rust-lang/rustup/blob/HEAD/rustup-init.sh
|
||||
case "$(uname -m)" in
|
||||
aarch64 | arm64) host_arch="aarch64" ;;
|
||||
xscale | arm | armv6l | armv7l | armv8l)
|
||||
# Ignore arm for now, as we need to consider the version and whether hard-float is supported.
|
||||
# https://github.com/rust-lang/rustup/pull/593
|
||||
# https://github.com/cross-rs/cross/pull/1018
|
||||
# Does it seem only armv7l is supported?
|
||||
# https://github.com/actions/runner/blob/6b9e8a6be411a6e63d5ccaf3c47e7b7622c5ec49/src/Misc/externals.sh#L174
|
||||
bail "32-bit ARM runner is not supported yet by this action"
|
||||
;;
|
||||
# GitHub Actions Runner supports Linux (x86_64, aarch64, arm), Windows (x86_64, aarch64),
|
||||
# and macOS (x86_64, aarch64).
|
||||
# https://github.com/actions/runner
|
||||
# https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#supported-architectures-and-operating-systems-for-self-hosted-runners
|
||||
# So we can assume x86_64 unless it is aarch64 or arm.
|
||||
*) host_arch="x86_64" ;;
|
||||
esac
|
||||
base_distro=""
|
||||
exe=""
|
||||
case "${OSTYPE}" in
|
||||
linux*)
|
||||
host_env="gnu"
|
||||
# Refs: https://github.com/rust-lang/rustup/blob/HEAD/rustup-init.sh
|
||||
if (ldd --version 2>&1 || true) | grep -q 'musl'; then
|
||||
host_env="musl"
|
||||
fi
|
||||
if grep -q '^ID_LIKE=' /etc/os-release; then
|
||||
base_distro="$(grep '^ID_LIKE=' /etc/os-release | sed 's/^ID_LIKE=//')"
|
||||
case "${base_distro}" in
|
||||
*debian*) base_distro=debian ;;
|
||||
*alpine*) base_distro=alpine ;;
|
||||
*fedora*) base_distro=fedora ;;
|
||||
esac
|
||||
else
|
||||
base_distro="$(grep '^ID=' /etc/os-release | sed 's/^ID=//')"
|
||||
fi
|
||||
case "${base_distro}" in
|
||||
fedora)
|
||||
dnf=dnf
|
||||
if ! type -P dnf &>/dev/null; then
|
||||
if type -P microdnf &>/dev/null; then
|
||||
# fedora-based distributions have "minimal" images that
|
||||
# use microdnf instead of dnf.
|
||||
dnf=microdnf
|
||||
else
|
||||
# If neither dnf nor microdnf is available, it is
|
||||
# probably an RHEL7-based distribution that does not
|
||||
# have dnf installed by default.
|
||||
dnf=yum
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
cygwin* | msys*) exe=".exe" ;;
|
||||
esac
|
||||
@@ -231,7 +270,7 @@ fi
|
||||
|
||||
if ! type -P curl &>/dev/null || ! type -P tar &>/dev/null; then
|
||||
case "${base_distro}" in
|
||||
debian | alpine) sys_install ca-certificates curl tar ;;
|
||||
debian | alpine | fedora) sys_install ca-certificates curl tar ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -253,7 +292,7 @@ for tool in "${tools[@]}"; do
|
||||
# https://github.com/taiki-e/cargo-hack/releases
|
||||
cargo-hack) latest_version="0.5.24" ;;
|
||||
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
||||
cargo-llvm-cov) latest_version="0.5.2" ;;
|
||||
cargo-llvm-cov) latest_version="0.5.3" ;;
|
||||
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
||||
cargo-minimal-versions) latest_version="0.1.8" ;;
|
||||
# https://github.com/taiki-e/parse-changelog/releases
|
||||
@@ -265,9 +304,14 @@ for tool in "${tools[@]}"; do
|
||||
latest) version="${latest_version}" ;;
|
||||
esac
|
||||
case "${OSTYPE}" in
|
||||
linux*) target="x86_64-unknown-linux-musl" ;;
|
||||
darwin*) target="x86_64-apple-darwin" ;;
|
||||
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
||||
linux*) target="${host_arch}-unknown-linux-musl" ;;
|
||||
darwin*) target="${host_arch}-apple-darwin" ;;
|
||||
cygwin* | msys*)
|
||||
case "${tool}" in
|
||||
cargo-llvm-cov) target="x86_64-pc-windows-msvc" ;;
|
||||
*) target="${host_arch}-pc-windows-msvc" ;;
|
||||
esac
|
||||
;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
esac
|
||||
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
|
||||
@@ -300,7 +344,7 @@ for tool in "${tools[@]}"; do
|
||||
download "${url}" "${cargo_bin}" "./${tool}-v${version}-${target}/${tool}${exe}"
|
||||
;;
|
||||
cargo-valgrind)
|
||||
# https://github.com/jfrimmel/cargo-valgrind
|
||||
# https://github.com/jfrimmel/cargo-valgrind/releases
|
||||
latest_version="2.1.0"
|
||||
repo="jfrimmel/${tool}"
|
||||
case "${version}" in
|
||||
@@ -333,7 +377,7 @@ for tool in "${tools[@]}"; do
|
||||
esac
|
||||
case "${OSTYPE}" in
|
||||
linux*) target="x86_64-unknown-linux-musl" ;;
|
||||
darwin*) target="x86_64-apple-darwin" ;;
|
||||
darwin*) target="${host_arch}-apple-darwin" ;;
|
||||
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
esac
|
||||
@@ -376,12 +420,12 @@ for tool in "${tools[@]}"; do
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
esac
|
||||
info "downloading ${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" \
|
||||
| tar xzf - -C "${cargo_bin}"
|
||||
;;
|
||||
protoc)
|
||||
# https://github.com/protocolbuffers/protobuf/releases
|
||||
latest_version="3.21.11"
|
||||
latest_version="3.21.12"
|
||||
repo="protocolbuffers/protobuf"
|
||||
case "${version}" in
|
||||
latest) version="${latest_version}" ;;
|
||||
@@ -398,21 +442,21 @@ for tool in "${tools[@]}"; do
|
||||
export PATH="${PATH}:${bin_dir}"
|
||||
fi
|
||||
case "${OSTYPE}" in
|
||||
linux*) url="${base_url}-linux-x86_64.zip" ;;
|
||||
darwin*) url="${base_url}-osx-x86_64.zip" ;;
|
||||
linux*) url="${base_url}-linux-${host_arch/aarch/aarch_}.zip" ;;
|
||||
darwin*) url="${base_url}-osx-${host_arch/aarch/aarch_}.zip" ;;
|
||||
cygwin* | msys*) url="${base_url}-win64.zip" ;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
esac
|
||||
if ! type -P unzip &>/dev/null; then
|
||||
case "${base_distro}" in
|
||||
debian | alpine) sys_install unzip ;;
|
||||
debian | alpine | fedora) sys_install unzip ;;
|
||||
esac
|
||||
fi
|
||||
mkdir -p .install-action-tmp
|
||||
(
|
||||
cd .install-action-tmp
|
||||
info "downloading ${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" -o tmp.zip
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp.zip
|
||||
unzip tmp.zip
|
||||
mv "bin/protoc${exe}" "${bin_dir}/"
|
||||
mkdir -p "${include_dir}/"
|
||||
@@ -441,7 +485,7 @@ for tool in "${tools[@]}"; do
|
||||
if type -P shellcheck &>/dev/null; then
|
||||
apt_remove shellcheck
|
||||
fi
|
||||
url="${base_url}.linux.x86_64.tar.xz"
|
||||
url="${base_url}.linux.${host_arch}.tar.xz"
|
||||
;;
|
||||
darwin*) url="${base_url}.darwin.x86_64.tar.xz" ;;
|
||||
cygwin* | msys*)
|
||||
@@ -461,8 +505,18 @@ for tool in "${tools[@]}"; do
|
||||
esac
|
||||
bin_dir="/usr/local/bin"
|
||||
case "${OSTYPE}" in
|
||||
linux*) target="linux_amd64" ;;
|
||||
darwin*) target="darwin_amd64" ;;
|
||||
linux*)
|
||||
case "${host_arch}" in
|
||||
aarch64) target="linux_arm64" ;;
|
||||
*) target="linux_amd64" ;;
|
||||
esac
|
||||
;;
|
||||
darwin*)
|
||||
case "${host_arch}" in
|
||||
aarch64) target="darwin_arm64" ;;
|
||||
*) target="darwin_amd64" ;;
|
||||
esac
|
||||
;;
|
||||
cygwin* | msys*)
|
||||
target="windows_amd64"
|
||||
bin_dir="${HOME}/.install-action/bin"
|
||||
@@ -476,7 +530,7 @@ for tool in "${tools[@]}"; do
|
||||
esac
|
||||
url="https://github.com/${repo}/releases/download/v${version}/${tool}_v${version}_${target}${exe}"
|
||||
info "downloading ${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused -o "${bin_dir}/${tool}${exe}" "${url}"
|
||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 -o "${bin_dir}/${tool}${exe}" "${url}"
|
||||
case "${OSTYPE}" in
|
||||
linux* | darwin*) chmod +x "${bin_dir}/${tool}${exe}" ;;
|
||||
esac
|
||||
@@ -505,7 +559,7 @@ for tool in "${tools[@]}"; do
|
||||
latest) version="${latest_version}" ;;
|
||||
esac
|
||||
case "${OSTYPE}" in
|
||||
linux*) target="x86_64-unknown-linux-musl" ;;
|
||||
linux*) target="${host_arch}-unknown-linux-musl" ;;
|
||||
darwin*) target="x86_64-apple-darwin" ;;
|
||||
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
@@ -515,7 +569,7 @@ for tool in "${tools[@]}"; do
|
||||
;;
|
||||
wasmtime)
|
||||
# https://github.com/bytecodealliance/wasmtime/releases
|
||||
latest_version="3.0.1"
|
||||
latest_version="4.0.0"
|
||||
repo="bytecodealliance/${tool}"
|
||||
case "${version}" in
|
||||
latest) version="${latest_version}" ;;
|
||||
@@ -523,11 +577,11 @@ for tool in "${tools[@]}"; do
|
||||
base_url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}"
|
||||
case "${OSTYPE}" in
|
||||
linux*)
|
||||
target="x86_64-linux"
|
||||
target="${host_arch}-linux"
|
||||
url="${base_url}-${target}.tar.xz"
|
||||
;;
|
||||
darwin*)
|
||||
target="x86_64-macos"
|
||||
target="${host_arch}-macos"
|
||||
url="${base_url}-${target}.tar.xz"
|
||||
;;
|
||||
cygwin* | msys*)
|
||||
@@ -540,14 +594,19 @@ for tool in "${tools[@]}"; do
|
||||
;;
|
||||
mdbook)
|
||||
# https://github.com/rust-lang/mdBook/releases
|
||||
latest_version="0.4.22"
|
||||
latest_version="0.4.25"
|
||||
repo="rust-lang/mdBook"
|
||||
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*) url="${base_url}-x86_64-unknown-linux-gnu.tar.gz" ;;
|
||||
linux*)
|
||||
case "${version}" in
|
||||
0.[1-3].* | 0.4.? | 0.4.1? | 0.4.2[0-1]) url="${base_url}-x86_64-unknown-linux-gnu.tar.gz" ;;
|
||||
*) url="${base_url}-${host_arch}-unknown-linux-musl.tar.gz" ;;
|
||||
esac
|
||||
;;
|
||||
darwin*) url="${base_url}-x86_64-apple-darwin.tar.gz" ;;
|
||||
cygwin* | msys*) url="${base_url}-x86_64-pc-windows-msvc.zip" ;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
|
||||
Reference in New Issue
Block a user