mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-03 11:40:35 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47e0a4c507 | ||
|
|
7909142ffc | ||
|
|
cc6a4561c7 | ||
|
|
e71b030c0f | ||
|
|
2e924a47e0 | ||
|
|
27b6cde93d | ||
|
|
238cf20a47 | ||
|
|
5d3b331fca | ||
|
|
362d8665ec | ||
|
|
0b1022563b | ||
|
|
70b038cf3c | ||
|
|
2e2f046ba3 | ||
|
|
bc0a06a003 | ||
|
|
8b8c667dd4 | ||
|
|
b0517abb78 | ||
|
|
e92f6df9a9 |
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -26,19 +26,20 @@ jobs:
|
|||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
tool:
|
tool:
|
||||||
# Note: Specifying the version of valgrind and wasm-pack is not supported.
|
# Note: Specifying the version of valgrind and wasm-pack is not supported.
|
||||||
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook
|
# cargo-watch is supported by cargo-binstall (through quickinstall)
|
||||||
- cargo-hack@0.5.13,cargo-llvm-cov@0.4.3,cargo-minimal-versions@0.1.3,parse-changelog@0.4.7,cross@0.2.1,nextest@0.9.11,shellcheck@0.8.0,shfmt@3.5.0,wasmtime@0.37.0,mdbook@0.4.18
|
- 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
|
||||||
# Nextest supports basic version ranges as well
|
# Nextest supports basic version ranges as well
|
||||||
- nextest@0.9
|
- nextest@0.9
|
||||||
include:
|
include:
|
||||||
# Note: mdBook binary is incompatible with ubuntu 18.04,
|
# Note: mdBook binary is incompatible with ubuntu 18.04,
|
||||||
# see https://github.com/rust-lang/mdBook/issues/1779
|
# see https://github.com/rust-lang/mdBook/issues/1779
|
||||||
- os: ubuntu-18.04
|
- os: ubuntu-18.04
|
||||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,valgrind,wasm-pack,wasmtime
|
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
|
- os: macos-10.15
|
||||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,wasm-pack,wasmtime,mdbook
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,cargo-watch
|
||||||
- os: windows-2019
|
- os: windows-2019
|
||||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,nextest,cargo-watch
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
32
CHANGELOG.md
32
CHANGELOG.md
@@ -10,6 +10,31 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.4.2] - 2022-06-16
|
||||||
|
|
||||||
|
- Update `cargo-llvm-cov@latest` to 0.4.8.
|
||||||
|
|
||||||
|
## [1.4.1] - 2022-06-13
|
||||||
|
|
||||||
|
- Update `cargo-llvm-cov@latest` to 0.4.7.
|
||||||
|
|
||||||
|
## [1.4.0] - 2022-06-10
|
||||||
|
|
||||||
|
- Support `cargo-binstall`. ([#8](https://github.com/taiki-e/install-action/pull/8), thanks @NobodyXu)
|
||||||
|
- Use `cargo-binstall` as a fallback if the unsupported package is specified. ([#8](https://github.com/taiki-e/install-action/pull/8), thanks @NobodyXu)
|
||||||
|
- Update `shfmt@latest` to 3.5.1.
|
||||||
|
|
||||||
|
## [1.3.13] - 2022-06-02
|
||||||
|
|
||||||
|
- Update `cargo-hack@latest` to 0.5.14.
|
||||||
|
- Update `cargo-llvm-cov@latest` to 0.4.5.
|
||||||
|
- Update `cargo-minimal-versions@latest` to 0.1.4.
|
||||||
|
- Update `parse-changelog@latest` to 0.4.8.
|
||||||
|
|
||||||
|
## [1.3.12] - 2022-05-30
|
||||||
|
|
||||||
|
- Update `cargo-llvm-cov@latest` to 0.4.4.
|
||||||
|
|
||||||
## [1.3.11] - 2022-05-29
|
## [1.3.11] - 2022-05-29
|
||||||
|
|
||||||
- Update `cargo-llvm-cov@latest` to 0.4.3.
|
- Update `cargo-llvm-cov@latest` to 0.4.3.
|
||||||
@@ -132,7 +157,12 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.3.11...HEAD
|
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.4.2...HEAD
|
||||||
|
[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
|
||||||
|
[1.3.13]: https://github.com/taiki-e/install-action/compare/v1.3.12...v1.3.13
|
||||||
|
[1.3.12]: https://github.com/taiki-e/install-action/compare/v1.3.11...v1.3.12
|
||||||
[1.3.11]: https://github.com/taiki-e/install-action/compare/v1.3.10...v1.3.11
|
[1.3.11]: https://github.com/taiki-e/install-action/compare/v1.3.10...v1.3.11
|
||||||
[1.3.10]: https://github.com/taiki-e/install-action/compare/v1.3.9...v1.3.10
|
[1.3.10]: https://github.com/taiki-e/install-action/compare/v1.3.9...v1.3.10
|
||||||
[1.3.9]: https://github.com/taiki-e/install-action/compare/v1.3.8...v1.3.9
|
[1.3.9]: https://github.com/taiki-e/install-action/compare/v1.3.8...v1.3.9
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ https://spdx.org/licenses
|
|||||||
| [**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) |
|
| [**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) |
|
| [**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) |
|
| [**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) |
|
||||||
|
| [**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.
|
||||||
|
|
||||||
<!-- TODO:
|
<!-- TODO:
|
||||||
| [**cmake**](https://cmake.org) | | [GitHub Releases](https://github.com/Kitware/CMake/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/Kitware/CMake/blob/HEAD/Copyright.txt) |
|
| [**cmake**](https://cmake.org) | | [GitHub Releases](https://github.com/Kitware/CMake/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/Kitware/CMake/blob/HEAD/Copyright.txt) |
|
||||||
@@ -93,8 +96,11 @@ If you want a higher level of security, consider working on [#1](https://github.
|
|||||||
|
|
||||||
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
|
- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.
|
||||||
- [upload-rust-binary-action]: GitHub Action for building and uploading Rust binary to GitHub Releases.
|
- [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
|
||||||
[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action
|
[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
|
[upload-rust-binary-action]: https://github.com/taiki-e/upload-rust-binary-action
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
83
main.sh
83
main.sh
@@ -30,6 +30,73 @@ warn() {
|
|||||||
info() {
|
info() {
|
||||||
echo "info: $*"
|
echo "info: $*"
|
||||||
}
|
}
|
||||||
|
install_cargo_binstall() {
|
||||||
|
cargo_bin="${CARGO_HOME:-$HOME/.cargo}/bin"
|
||||||
|
|
||||||
|
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" ;;
|
||||||
|
|
||||||
|
armv7-unknown-linux-gnueabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
|
||||||
|
armv7-unknown-linux-musleabihf) url="${base_url}-armv7-unknown-linux-musleabihf.tgz" ;;
|
||||||
|
|
||||||
|
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-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
|
||||||
|
else
|
||||||
|
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
cargo_binstall() {
|
||||||
|
tool="$1"
|
||||||
|
version="$2"
|
||||||
|
|
||||||
|
info "install-action does not support ${tool}, fallback to cargo-binstall"
|
||||||
|
|
||||||
|
install_cargo_binstall
|
||||||
|
|
||||||
|
case "${version}" in
|
||||||
|
latest)
|
||||||
|
cargo binstall --no-confirm "$tool"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cargo binstall --no-confirm --version "$version" "$tool"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
bail "invalid argument '$1'"
|
bail "invalid argument '$1'"
|
||||||
@@ -57,13 +124,13 @@ for tool in "${tools[@]}"; do
|
|||||||
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
|
cargo-hack | cargo-llvm-cov | cargo-minimal-versions | parse-changelog)
|
||||||
case "${tool}" in
|
case "${tool}" in
|
||||||
# https://github.com/taiki-e/cargo-hack/releases
|
# https://github.com/taiki-e/cargo-hack/releases
|
||||||
cargo-hack) latest_version="0.5.13" ;;
|
cargo-hack) latest_version="0.5.14" ;;
|
||||||
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
||||||
cargo-llvm-cov) latest_version="0.4.3" ;;
|
cargo-llvm-cov) latest_version="0.4.8" ;;
|
||||||
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
||||||
cargo-minimal-versions) latest_version="0.1.3" ;;
|
cargo-minimal-versions) latest_version="0.1.4" ;;
|
||||||
# https://github.com/taiki-e/parse-changelog/releases
|
# https://github.com/taiki-e/parse-changelog/releases
|
||||||
parse-changelog) latest_version="0.4.7" ;;
|
parse-changelog) latest_version="0.4.8" ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
repo="taiki-e/${tool}"
|
repo="taiki-e/${tool}"
|
||||||
@@ -135,7 +202,7 @@ for tool in "${tools[@]}"; do
|
|||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# https://github.com/mvdan/sh/releases
|
# https://github.com/mvdan/sh/releases
|
||||||
latest_version="3.5.0"
|
latest_version="3.5.1"
|
||||||
repo="mvdan/sh"
|
repo="mvdan/sh"
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*) target="linux_amd64" ;;
|
linux*) target="linux_amd64" ;;
|
||||||
@@ -213,7 +280,11 @@ for tool in "${tools[@]}"; do
|
|||||||
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${url}" \
|
||||||
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
|
| tar xzf - -C ${CARGO_HOME:-~/.cargo}/bin
|
||||||
;;
|
;;
|
||||||
*) bail "unsupported tool '${tool}'" ;;
|
cargo-binstall) install_cargo_binstall ;;
|
||||||
|
*)
|
||||||
|
cargo_binstall "$tool" "$version"
|
||||||
|
continue
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
info "${tool} installed at $(type -P "${tool}")"
|
info "${tool} installed at $(type -P "${tool}")"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ fi
|
|||||||
tags=$(git --no-pager tag)
|
tags=$(git --no-pager tag)
|
||||||
if [[ -n "${tags}" ]]; then
|
if [[ -n "${tags}" ]]; then
|
||||||
# Make sure the same release does not exist in CHANGELOG.md.
|
# Make sure the same release does not exist in CHANGELOG.md.
|
||||||
release_date=$(date --utc '+%Y-%m-%d')
|
release_date=$(date -u '+%Y-%m-%d')
|
||||||
if grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
if grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||||
bail "release ${version} already exist in CHANGELOG.md"
|
bail "release ${version} already exist in CHANGELOG.md"
|
||||||
fi
|
fi
|
||||||
@@ -89,6 +89,7 @@ tools=(
|
|||||||
wasm-pack
|
wasm-pack
|
||||||
wasmtime
|
wasmtime
|
||||||
mdbook
|
mdbook
|
||||||
|
cargo-binstall
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user