Compare commits

...

35 Commits

Author SHA1 Message Date
Taiki Endo
fd84b52d9c Release 1.6.0 2022-07-25 19:40:48 +09:00
Taiki Endo
d637ba13b3 Set PATH internally when cargo home is not available 2022-07-25 19:38:45 +09:00
Taiki Endo
f343021ffc Cleanup
- Support mdbook-linkcheck.
- Support mdbook on Windows.
- Support wasmtime on Windows.
- Support nextest on Linux (musl).
- Fix installation failure when `$CARGO_HOME/bin` or `$HOME/.cargo/bin` is not available.

Fixes #11
2022-07-25 19:26:13 +09:00
Taiki Endo
d7602d9dcb Release 1.5.11 2022-07-25 14:49:21 +09:00
Taiki Endo
31800b17cc Fix cargo-binstall installation
Fixes #10
2022-07-25 14:47:39 +09:00
Taiki Endo
e6302a3430 Release 1.5.10 2022-07-24 13:22:47 +09:00
Taiki Endo
1e5fc1d1ff Update parse-changelog to 0.5.0 2022-07-24 13:08:44 +09:00
Taiki Endo
ca9824f699 Release 1.5.9 2022-07-23 03:34:27 +09:00
Taiki Endo
de0d285973 Update mdbook to 0.4.21 2022-07-23 03:32:40 +09:00
Taiki Endo
fb59c794dd Use macos-11 instead of deprecated macos-10.15
Refs: https://github.com/actions/virtual-environments/issues/5583
2022-07-21 21:58:15 +09:00
Taiki Endo
daa62f7ff1 Update wasmtime to 0.39.1 2022-07-21 21:58:07 +09:00
Taiki Endo
f113ef4cd9 Release 1.5.8 2022-07-21 10:16:36 +09:00
Taiki Endo
6a6a02956b Update wasmtime to 0.39.0 2022-07-21 10:07:56 +09:00
Taiki Endo
782f135cee Release 1.5.7 2022-07-21 00:18:12 +09:00
Taiki Endo
d39d50062b Update cargo-llvm-cov to 0.4.11 2022-07-21 00:16:52 +09:00
Taiki Endo
6f1ebcd9e2 Release 1.5.6 2022-07-18 16:01:38 +09:00
Taiki Endo
161dccbf9a Update cargo-llvm-cov to 0.4.10 2022-07-18 15:54:38 +09:00
Taiki Endo
b410f0ad6a Release 1.5.5 2022-07-18 14:25:59 +09:00
Taiki Endo
e067205061 Update cargo-hack to 0.5.15 2022-07-18 14:19:39 +09:00
Taiki Endo
78118df4d7 Release 1.5.4 2022-07-16 17:23:56 +09:00
Taiki Endo
1cbab0616a Update cross, cargo-minimal-versions, and parse-changelog 2022-07-16 17:22:27 +09:00
Taiki Endo
e937b634a0 Update mdbook to 0.4.20 2022-07-16 16:19:22 +09:00
Taiki Endo
37f510303a Release 1.5.3 2022-07-08 00:35:25 +09:00
Taiki Endo
841e33c134 Update cargo-llvm-cov to 0.4.9 2022-07-08 00:28:29 +09:00
Taiki Endo
095ba5e160 Update tools/publish.sh 2022-07-06 03:39:38 +09:00
Taiki Endo
0e32218b80 Release 1.5.2 2022-07-03 01:22:05 +09:00
Taiki Endo
4a4d2c21ca Update cross to 0.2.2 2022-07-02 22:50:11 +09:00
Taiki Endo
64d4f090ec Revert "Update cross to 0.2.2"
This reverts commit 60952837b3.
2022-07-02 22:40:49 +09:00
Taiki Endo
60952837b3 Update cross to 0.2.2 2022-07-02 22:38:45 +09:00
Taiki Endo
640bc768ee Release 1.5.1 2022-07-02 22:34:50 +09:00
Taiki Endo
d5b4eb3fc2 Update mdbook to 0.4.19 2022-07-02 21:04:09 +09:00
Taiki Endo
83e8fa8971 Release 1.5.0 2022-06-29 00:36:31 +09:00
Taiki Endo
2ab583ea78 Update changelog 2022-06-29 00:32:07 +09:00
Taiki Endo
6745402100 Update wasmtime to 0.38.1 2022-06-29 00:30:20 +09:00
Jiahao XU
03433ef024 Enable secure mode for cargo-binstall (#9)
`--secure` mode enforce downloads over secure transports only.
As a result, http will be disabled, and it will also set
min tls version to be 1.2

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-29 00:28:27 +09:00
5 changed files with 227 additions and 95 deletions

View File

@@ -27,19 +27,19 @@ jobs:
tool:
# Note: Specifying the version of valgrind and wasm-pack is not supported.
# cargo-watch is supported by cargo-binstall (through quickinstall)
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,cargo-watch
- cargo-hack@0.5.14,cargo-llvm-cov@0.4.8,cargo-minimal-versions@0.1.4,parse-changelog@0.4.8,cross@0.2.1,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.1,wasmtime@0.37.0,mdbook@0.4.18,cargo-watch@8.1.1
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
- cargo-hack@0.5.15,cargo-llvm-cov@0.4.11,cargo-minimal-versions@0.1.5,parse-changelog@0.5.0,cross@0.2.4,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.1,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,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,cargo-watch
- os: macos-10.15
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,cargo-watch
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,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,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,cargo-watch
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

View File

@@ -10,6 +10,67 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased]
## [1.6.0] - 2022-07-25
- Support mdbook-linkcheck.
- Support mdbook on Windows.
- Support wasmtime on Windows.
- Support nextest on Linux (musl).
- Fix installation failure when `$CARGO_HOME/bin` or `$HOME/.cargo/bin` is not available.
## [1.5.11] - 2022-07-25
- Fix cargo-binstall installation on macOS and Windows.
## [1.5.10] - 2022-07-24
- Update `parse-changelog@latest` to 0.5.0.
## [1.5.9] - 2022-07-22
- Update `wasmtime@latest` to 0.39.1.
- Update `mdbook@latest` to 0.4.21.
## [1.5.8] - 2022-07-21
- Update `wasmtime@latest` to 0.39.0.
## [1.5.7] - 2022-07-20
- Update `cargo-llvm-cov@latest` to 0.4.11.
## [1.5.6] - 2022-07-18
- Update `cargo-llvm-cov@latest` to 0.4.10.
## [1.5.5] - 2022-07-18
- Update `cargo-hack@latest` to 0.5.15.
## [1.5.4] - 2022-07-16
- Update `mdbook@latest` to 0.4.20.
- Update `cross@latest` to 0.2.4.
- Update `cargo-minimal-versions@latest` to 0.1.5.
- Update `parse-changelog@latest` to 0.4.9.
## [1.5.3] - 2022-07-07
- Update `cargo-llvm-cov@latest` to 0.4.9.
## [1.5.2] - 2022-07-02
- Update `cross@latest` to 0.2.2.
## [1.5.1] - 2022-07-02
- Update `mdbook@latest` to 0.4.19.
## [1.5.0] - 2022-06-28
- Enable secure mode for `cargo-binstall`. ([#9](https://github.com/taiki-e/install-action/pull/9), thanks @NobodyXu)
- Update `wasmtime@latest` to 0.38.1.
## [1.4.2] - 2022-06-16
- Update `cargo-llvm-cov@latest` to 0.4.8.
@@ -157,7 +218,20 @@ 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.4.2...HEAD
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.6.0...HEAD
[1.6.0]: https://github.com/taiki-e/install-action/compare/v1.5.11...v1.6.0
[1.5.11]: https://github.com/taiki-e/install-action/compare/v1.5.10...v1.5.11
[1.5.10]: https://github.com/taiki-e/install-action/compare/v1.5.9...v1.5.10
[1.5.9]: https://github.com/taiki-e/install-action/compare/v1.5.8...v1.5.9
[1.5.8]: https://github.com/taiki-e/install-action/compare/v1.5.7...v1.5.8
[1.5.7]: https://github.com/taiki-e/install-action/compare/v1.5.6...v1.5.7
[1.5.6]: https://github.com/taiki-e/install-action/compare/v1.5.5...v1.5.6
[1.5.5]: https://github.com/taiki-e/install-action/compare/v1.5.4...v1.5.5
[1.5.4]: https://github.com/taiki-e/install-action/compare/v1.5.3...v1.5.4
[1.5.3]: https://github.com/taiki-e/install-action/compare/v1.5.2...v1.5.3
[1.5.2]: https://github.com/taiki-e/install-action/compare/v1.5.1...v1.5.2
[1.5.1]: https://github.com/taiki-e/install-action/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/taiki-e/install-action/compare/v1.4.2...v1.5.0
[1.4.2]: https://github.com/taiki-e/install-action/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/taiki-e/install-action/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/taiki-e/install-action/compare/v1.3.13...v1.4.0

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.11
tool: cargo-hack@0.5.15
```
To install multiple tools:
@@ -76,8 +76,9 @@ https://spdx.org/licenses
| [**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) |
| [**wasm-pack**](https://github.com/rustwasm/wasm-pack) | `~/.cargo/bin` | [GitHub Releases](https://github.com/rustwasm/wasm-pack/releases) | Linux, macOS | [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/bin` | [GitHub Releases](https://github.com/bytecodealliance/wasmtime/releases) | Linux, macOS | [Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/HEAD/LICENSE) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `~/.cargo/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/HEAD/LICENSE) |
| [**wasmtime**](https://github.com/bytecodealliance/wasmtime) | `~/.cargo/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) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `~/.cargo/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/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) |
| [**cargo-binstall**][cargo-binstall] | `~/.cargo/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) |
If a tool not included in the list above is specified, this action uses [cargo-binstall] as a fallback.

211
main.sh
View File

@@ -30,15 +30,45 @@ warn() {
info() {
echo "info: $*"
}
download() {
local url="$1"
local bin_dir="$2"
local bin="$3"
local tar_args=()
case "${url}" in
*.tar.gz | *.tgz) tar_args+=("xzf") ;;
*.tar.bz2 | *.tbz2) tar_args+=("xjf") ;;
*.tar.xz | *.txz) tar_args+=("xJf") ;;
*.zip)
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
unzip tmp.zip
mv "${bin}" "${bin_dir}/"
)
rm -rf .install-action-tmp
return 0
;;
*) bail "unrecognized archive format '${url}' for ${tool}" ;;
esac
tar_args+=("-")
local components
components=$(tr <<<"${bin}" -cd '/' | wc -c)
if [[ "${components}" != "0" ]]; then
tar_args+=(--strip-components "${components}")
fi
info "downloading ${url}..."
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar "${tar_args[@]}" -C "${bin_dir}" "${bin}"
}
install_cargo_binstall() {
cargo_bin="${CARGO_HOME:-$HOME/.cargo}/bin"
if [ ! -f "${cargo_bin}/cargo-binstall" ]; then
if [[ ! -f "${cargo_bin}/cargo-binstall" ]]; then
info "installing cargo-binstall"
target="$(rustc -vV | grep host | cut -c 7-)"
base_url=https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall
is_zip=false
case "${target}" 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" ;;
@@ -49,52 +79,34 @@ install_cargo_binstall() {
aarch64-unknown-linux-gnu) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
aarch64-unknown-linux-musl) url="${base_url}-aarch64-unknown-linux-musl.tgz" ;;
x86_64-pc-windows-gnu)
is_zip=true
url="${base_url}-x86_64-pc-windows-msvc.zip"
;;
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)
is_zip=true
url="${base_url}-${target}.zip"
;;
*) bail "unsupported target '${target}' for cargo-binstall" ;;
esac
if [ $is_zip = true ]; then
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "$url" -o "cargo-binstall-${target}.zip"
unzip "cargo-binstall-${target}.zip"
rm "cargo-binstall-${target}.zip"
else
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "$url" | tar xzf -
fi
mkdir -p "{cargo_bin}/"
case "${OSTYPE}" in
cygwin* | msys*) mv cargo-binstall.exe "${cargo_bin}/" ;;
*) mv cargo-binstall "${cargo_bin}/" ;;
esac
download "${url}" "${cargo_bin}" "cargo-binstall${exe}"
else
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall"
fi
}
cargo_binstall() {
tool="$1"
version="$2"
local tool="$1"
local version="$2"
info "install-action does not support ${tool}, fallback to cargo-binstall"
install_cargo_binstall
# --secure mode enforce downloads over secure transports only.
# 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 --no-confirm "$tool"
;;
*)
cargo binstall --no-confirm --version "$version" "$tool"
;;
latest) cargo binstall --secure --no-confirm "$tool" ;;
*) cargo binstall --secure --no-confirm --version "$version" "$tool" ;;
esac
}
@@ -106,12 +118,21 @@ export DEBIAN_FRONTEND=noninteractive
# Inputs
tool="${INPUT_TOOL:-}"
tools=()
if [[ -n "${tool}" ]]; then
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
fi
exe=""
case "${OSTYPE}" in
cygwin* | msys*) exe=".exe" ;;
esac
cargo_bin="${CARGO_HOME:-"$HOME/.cargo"}/bin"
mkdir -p "${cargo_bin}"
# For version check. It is intentional that this is not wrote in GITHUB_ENV.
export PATH="${cargo_bin}:$PATH"
for tool in "${tools[@]}"; do
if [[ "${tool}" == *"@"* ]]; then
version="${tool#*@}"
@@ -124,13 +145,13 @@ 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.14" ;;
cargo-hack) latest_version="0.5.15" ;;
# https://github.com/taiki-e/cargo-llvm-cov/releases
cargo-llvm-cov) latest_version="0.4.8" ;;
cargo-llvm-cov) latest_version="0.4.11" ;;
# https://github.com/taiki-e/cargo-minimal-versions/releases
cargo-minimal-versions) latest_version="0.1.4" ;;
cargo-minimal-versions) latest_version="0.1.5" ;;
# https://github.com/taiki-e/parse-changelog/releases
parse-changelog) latest_version="0.4.8" ;;
parse-changelog) latest_version="0.5.0" ;;
*) exit 1 ;;
esac
repo="taiki-e/${tool}"
@@ -144,13 +165,11 @@ for tool in "${tools[@]}"; do
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
cross)
# https://github.com/cross-rs/cross/releases
latest_version="0.2.1"
latest_version="0.2.4"
repo="cross-rs/cross"
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-musl" ;;
@@ -161,44 +180,54 @@ for tool in "${tools[@]}"; do
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/cross-v${version}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
case "${version}" in
0.1.* | 0.2.[0-1]) url="https://github.com/${repo}/releases/download/v${version}/cross-v${version}-${target}.tar.gz" ;;
*) url="https://github.com/${repo}/releases/download/v${version}/cross-${target}.tar.gz" ;;
esac
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
nextest)
# https://nexte.st/book/pre-built-binaries.html
case "${OSTYPE}" in
linux*) url="https://get.nexte.st/${version}/linux" ;;
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" ;;
*) url="https://get.nexte.st/${version}/linux-musl" ;;
esac
;;
darwin*) url="https://get.nexte.st/${version}/mac" ;;
cygwin* | msys*) url="https://get.nexte.st/${version}/windows-tar" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
# shellcheck disable=SC2086
info "downloading ${url}..."
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
| tar xzf - -C "${cargo_bin}"
;;
shellcheck)
# https://github.com/koalaman/shellcheck/releases
latest_version="0.8.0"
repo="koalaman/shellcheck"
case "${version}" in
latest) version="${latest_version}" ;;
esac
base_url="https://github.com/${repo}/releases/download/v${version}/shellcheck-v${version}"
case "${OSTYPE}" in
linux*)
if type -P shellcheck &>/dev/null; then
sudo apt-get -qq -o Dpkg::Use-Pty=0 remove -y shellcheck
fi
target="linux"
url="${base_url}.linux.x86_64.tar.xz"
;;
darwin*) url="${base_url}.darwin.x86_64.tar.xz" ;;
cygwin* | msys*)
# TODO: In what directory should we install the binaries?
# url="${base_url}.zip"
bail "${tool} for windows is not supported yet by this action"
;;
darwin*) target="darwin" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/shellcheck-v${version}.${target}.x86_64.tar.xz"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xJf - --strip-components 1 -C /usr/local/bin "shellcheck-v${version}/shellcheck"
download "${url}" /usr/local/bin "shellcheck-v${version}/shellcheck"
;;
shfmt)
# https://github.com/mvdan/sh/releases
@@ -207,13 +236,18 @@ for tool in "${tools[@]}"; do
case "${OSTYPE}" in
linux*) target="linux_amd64" ;;
darwin*) target="darwin_amd64" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
cygwin* | msys*)
# TODO: In what directory should we install the binaries?
# target="windows_amd64"
bail "${tool} for windows is not supported yet by this action"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/shfmt_v${version}_${target}"
url="https://github.com/${repo}/releases/download/v${version}/shfmt_v${version}_${target}${exe}"
info "downloading ${url}..."
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused -o /usr/local/bin/shfmt "${url}"
chmod +x /usr/local/bin/shfmt
;;
@@ -245,44 +279,67 @@ for tool in "${tools[@]}"; do
;;
wasmtime)
# https://github.com/bytecodealliance/wasmtime/releases
latest_version="0.37.0"
latest_version="0.39.1"
repo="bytecodealliance/wasmtime"
case "${OSTYPE}" in
linux*) target="x86_64-linux" ;;
darwin*) target="x86_64-macos" ;;
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/bytecodealliance/wasmtime/releases/download/v${version}/wasmtime-v${version}-${target}.tar.xz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xJf - --strip-components 1 -C ${CARGO_HOME:-~/.cargo}/bin "wasmtime-v${version}-${target}/wasmtime"
base_url="https://github.com/bytecodealliance/wasmtime/releases/download/v${version}/wasmtime-v${version}"
case "${OSTYPE}" in
linux*)
target="x86_64-linux"
url="${base_url}-${target}.tar.xz"
;;
darwin*)
target="x86_64-macos"
url="${base_url}-${target}.tar.xz"
;;
cygwin* | msys*)
target="x86_64-windows"
url="${base_url}-${target}.zip"
;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
download "${url}" "${cargo_bin}" "${tool}-v${version}-${target}/${tool}${exe}"
;;
mdbook)
# https://github.com/rust-lang/mdBook/releases
latest_version="0.4.18"
latest_version="0.4.21"
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" ;;
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}" ;;
esac
download "${url}" "${cargo_bin}" "${tool}${exe}"
;;
mdbook-linkcheck)
# https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases
latest_version="0.7.6"
repo="Michael-F-Bryan/mdbook-linkcheck"
case "${OSTYPE}" in
linux*) target="x86_64-unknown-linux-gnu" ;;
darwin*) target="x86_64-apple-darwin" ;;
# TODO: mdbook has windows binaries, but they use `.zip` and not `.tar.gz`.
cygwin* | msys*) bail "${tool} for windows is not supported yet by this action" ;;
cygwin* | msys*) target="x86_64-pc-windows-msvc" ;;
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
esac
case "${version}" in
latest) version="${latest_version}" ;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${tool}-v${version}-${target}.tar.gz"
# shellcheck disable=SC2086
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
url="https://github.com/${repo}/releases/download/v${version}/${tool}.${target}.zip"
download "${url}" "${cargo_bin}" "${tool}${exe}"
case "${OSTYPE}" in
linux* | darwin*) chmod +x "${cargo_bin}/${tool}${exe}" ;;
esac
;;
cargo-binstall) install_cargo_binstall ;;
*)
cargo_binstall "$tool" "$version"
cargo_binstall "${tool}" "${version}"
continue
;;
esac

View File

@@ -99,16 +99,16 @@ tools=(
git push origin main
git push origin --tags
version_tag="v${version%%.*}"
git checkout -b "${version_tag}"
git push origin refs/heads/"${version_tag}"
if git --no-pager tag | grep -Eq "^${version_tag}$"; then
git tag -d "${version_tag}"
git push --delete origin refs/tags/"${version_tag}"
major_version_tag="v${version%%.*}"
git checkout -b "${major_version_tag}"
git push origin refs/heads/"${major_version_tag}"
if git --no-pager tag | grep -Eq "^${major_version_tag}$"; then
git tag -d "${major_version_tag}"
git push --delete origin refs/tags/"${major_version_tag}"
fi
git tag "${version_tag}"
git tag "${major_version_tag}"
git checkout main
git branch -d "${version_tag}"
git branch -d "${major_version_tag}"
)
for tool in "${tools[@]}"; do