Compare commits

...

8 Commits

Author SHA1 Message Date
Taiki Endo
de0e9b667c Release 1.10.2 2022-08-01 19:49:40 +09:00
Taiki Endo
45e69d69e2 Support protoc on Windows 2022-08-01 19:43:41 +09:00
Taiki Endo
9c40419eb7 Release 1.10.1 2022-08-01 18:19:11 +09:00
Taiki Endo
b8a66e6289 Update readme and changelog 2022-08-01 18:19:01 +09:00
Taiki Endo
a8803585a3 Fix missing include files when installing protoc on Linux and macOS 2022-08-01 18:07:53 +09:00
Taiki Endo
80528fecb9 Release 1.10.0 2022-08-01 17:43:41 +09:00
Taiki Endo
878e967972 Set PROTOC environment variable when installing protoc 2022-08-01 17:40:32 +09:00
Taiki Endo
b1b32c59f1 Tweak readme 2022-08-01 17:30:50 +09:00
3 changed files with 54 additions and 5 deletions

View File

@@ -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

View File

@@ -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
View File

@@ -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