mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-06 21:20:26 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c40419eb7 | ||
|
|
b8a66e6289 | ||
|
|
a8803585a3 | ||
|
|
80528fecb9 | ||
|
|
878e967972 | ||
|
|
b1b32c59f1 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -10,6 +10,16 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.10.1] - 2022-08-01
|
||||
|
||||
- Fix missing include files when installing `protoc` on Linux and macOS.
|
||||
|
||||
- Installation of `protoc` on Windows is not currently working (in all released versions) and is considered unsupported.
|
||||
|
||||
## [1.10.0] - 2022-08-01
|
||||
|
||||
- Set the `PROTOC` environment variable when installing `protoc` if it has not already been set.
|
||||
|
||||
## [1.9.0] - 2022-08-01
|
||||
|
||||
- Support `protoc`.
|
||||
@@ -257,7 +267,9 @@ 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.9.0...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.10.1...HEAD
|
||||
[1.10.1]: https://github.com/taiki-e/install-action/compare/v1.10.0...v1.10.1
|
||||
[1.10.0]: https://github.com/taiki-e/install-action/compare/v1.9.0...v1.10.0
|
||||
[1.9.0]: https://github.com/taiki-e/install-action/compare/v1.8.4...v1.9.0
|
||||
[1.8.4]: https://github.com/taiki-e/install-action/compare/v1.8.3...v1.8.4
|
||||
[1.8.3]: https://github.com/taiki-e/install-action/compare/v1.8.2...v1.8.3
|
||||
|
||||
@@ -75,7 +75,7 @@ https://spdx.org/licenses
|
||||
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/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) |
|
||||
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/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) |
|
||||
| [**nextest**](https://github.com/nextest-rs/nextest) (alias: `cargo-nextest`) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/nextest-rs/nextest/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-APACHE) OR [MIT](https://github.com/nextest-rs/nextest/blob/HEAD/LICENSE-MIT) |
|
||||
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `/usr/local/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
|
||||
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `/usr/local/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
|
||||
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0-or-later](https://github.com/koalaman/shellcheck/blob/HEAD/LICENSE) |
|
||||
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [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) |
|
||||
@@ -84,7 +84,7 @@ https://spdx.org/licenses
|
||||
|
||||
If `$CARGO_HOME/bin` is not available, Rust-related binaries will be installed to `$HOME/.cargo/bin`.<br>
|
||||
If `$HOME/.cargo/bin` is not available, Rust-related binaries will be installed to `/usr/local/bin`.<br>
|
||||
If `/usr/local/bin` is not available, all binaries will be installed to `$HOME/.install-action/bin`.<br>
|
||||
If `/usr/local/bin` is not available, binaries will be installed to `$HOME/.install-action/bin`.<br>
|
||||
|
||||
If a tool not included in the list above is specified, this action uses [cargo-binstall] as a fallback.
|
||||
|
||||
|
||||
35
main.sh
35
main.sh
@@ -54,7 +54,7 @@ download() {
|
||||
(
|
||||
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 --retry-connrefused "${url}" -o tmp.zip
|
||||
unzip tmp.zip
|
||||
mv "${bin}" "${bin_dir}/"
|
||||
)
|
||||
@@ -232,13 +232,42 @@ for tool in "${tools[@]}"; do
|
||||
esac
|
||||
miner_patch_version="${latest_version#*.}"
|
||||
base_url="https://github.com/${repo}/releases/download/v${miner_patch_version}/protoc-${miner_patch_version}"
|
||||
bin_dir="/usr/local/bin"
|
||||
include_dir="/usr/local/include"
|
||||
case "${OSTYPE}" in
|
||||
linux*) url="${base_url}-linux-x86_64.zip" ;;
|
||||
darwin*) url="${base_url}-osx-x86_64.zip" ;;
|
||||
cygwin* | msys*) url="${base_url}-win64.zip" ;;
|
||||
cygwin* | msys*)
|
||||
url="${base_url}-win64.zip"
|
||||
bin_dir="${HOME}/.install-action/bin"
|
||||
# TODO
|
||||
include_dir=""
|
||||
if [[ ! -d "${bin_dir}" ]]; then
|
||||
mkdir -p "${bin_dir}"
|
||||
echo "${bin_dir}" >>"${GITHUB_PATH}"
|
||||
export PATH="${PATH}:${bin_dir}"
|
||||
fi
|
||||
;;
|
||||
*) bail "unsupported OSTYPE '${OSTYPE}' for ${tool}" ;;
|
||||
esac
|
||||
download "${url}" /usr/local/bin "bin/protoc${exe}"
|
||||
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/protoc${exe}" "${bin_dir}/"
|
||||
if [[ -n "${include_dir}" ]]; then
|
||||
mkdir -p "${include_dir}/"
|
||||
sudo cp -r include/. "${include_dir}/"
|
||||
ls "${include_dir}/"
|
||||
fi
|
||||
)
|
||||
rm -rf .install-action-tmp
|
||||
if [[ -z "${PROTOC:-}" ]]; then
|
||||
info "setting PROTOC environment variable"
|
||||
echo "PROTOC=${bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
|
||||
fi
|
||||
;;
|
||||
shellcheck)
|
||||
# https://github.com/koalaman/shellcheck/releases
|
||||
|
||||
Reference in New Issue
Block a user