mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-04 04:00:30 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de0e9b667c | ||
|
|
45e69d69e2 | ||
|
|
9c40419eb7 | ||
|
|
b8a66e6289 | ||
|
|
a8803585a3 | ||
|
|
80528fecb9 | ||
|
|
878e967972 | ||
|
|
b1b32c59f1 |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -10,6 +10,20 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.10.2] - 2022-08-01
|
||||
|
||||
- Support `protoc` on Windows.
|
||||
|
||||
## [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 +271,10 @@ 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.2...HEAD
|
||||
[1.10.2]: https://github.com/taiki-e/install-action/compare/v1.10.1...v1.10.2
|
||||
[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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
38
main.sh
38
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,45 @@ 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"
|
||||
include_dir="${HOME}/.install-action/include"
|
||||
if [[ ! -d "${bin_dir}" ]]; then
|
||||
mkdir -p "${bin_dir}"
|
||||
mkdir -p "${include_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}/"
|
||||
mkdir -p "${include_dir}/"
|
||||
case "${OSTYPE}" in
|
||||
linux* | darwin*) sudo cp -r include/. "${include_dir}/" ;;
|
||||
cygwin* | msys*)
|
||||
cp -r include/. "${include_dir}/"
|
||||
bin_dir=$(sed <<<"${bin_dir}" 's/^\/c\//C:\\/')
|
||||
;;
|
||||
esac
|
||||
if [[ -z "${PROTOC:-}" ]]; then
|
||||
info "setting PROTOC environment variable"
|
||||
echo "PROTOC=${bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
|
||||
fi
|
||||
)
|
||||
rm -rf .install-action-tmp
|
||||
;;
|
||||
shellcheck)
|
||||
# https://github.com/koalaman/shellcheck/releases
|
||||
|
||||
Reference in New Issue
Block a user