mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-10 06:30:32 +00:00
Support protoc on Windows
This commit is contained in:
@@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- Support `protoc` on Windows.
|
||||||
|
|
||||||
## [1.10.1] - 2022-08-01
|
## [1.10.1] - 2022-08-01
|
||||||
|
|
||||||
- Fix missing include files when installing `protoc` on Linux and macOS.
|
- Fix missing include files when installing `protoc` on Linux and macOS.
|
||||||
|
|||||||
@@ -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-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) |
|
| [**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) |
|
| [**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 | [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, Windows | [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) |
|
| [**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) |
|
| [**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) |
|
| [**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) |
|
||||||
|
|||||||
23
main.sh
23
main.sh
@@ -240,10 +240,10 @@ for tool in "${tools[@]}"; do
|
|||||||
cygwin* | msys*)
|
cygwin* | msys*)
|
||||||
url="${base_url}-win64.zip"
|
url="${base_url}-win64.zip"
|
||||||
bin_dir="${HOME}/.install-action/bin"
|
bin_dir="${HOME}/.install-action/bin"
|
||||||
# TODO
|
include_dir="${HOME}/.install-action/include"
|
||||||
include_dir=""
|
|
||||||
if [[ ! -d "${bin_dir}" ]]; then
|
if [[ ! -d "${bin_dir}" ]]; then
|
||||||
mkdir -p "${bin_dir}"
|
mkdir -p "${bin_dir}"
|
||||||
|
mkdir -p "${include_dir}"
|
||||||
echo "${bin_dir}" >>"${GITHUB_PATH}"
|
echo "${bin_dir}" >>"${GITHUB_PATH}"
|
||||||
export PATH="${PATH}:${bin_dir}"
|
export PATH="${PATH}:${bin_dir}"
|
||||||
fi
|
fi
|
||||||
@@ -257,17 +257,20 @@ for tool in "${tools[@]}"; do
|
|||||||
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
|
unzip tmp.zip
|
||||||
mv "bin/protoc${exe}" "${bin_dir}/"
|
mv "bin/protoc${exe}" "${bin_dir}/"
|
||||||
if [[ -n "${include_dir}" ]]; then
|
mkdir -p "${include_dir}/"
|
||||||
mkdir -p "${include_dir}/"
|
case "${OSTYPE}" in
|
||||||
sudo cp -r include/. "${include_dir}/"
|
linux* | darwin*) sudo cp -r include/. "${include_dir}/" ;;
|
||||||
ls "${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
|
fi
|
||||||
)
|
)
|
||||||
rm -rf .install-action-tmp
|
rm -rf .install-action-tmp
|
||||||
if [[ -z "${PROTOC:-}" ]]; then
|
|
||||||
info "setting PROTOC environment variable"
|
|
||||||
echo "PROTOC=${bin_dir}/protoc${exe}" >>"${GITHUB_ENV}"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
shellcheck)
|
shellcheck)
|
||||||
# https://github.com/koalaman/shellcheck/releases
|
# https://github.com/koalaman/shellcheck/releases
|
||||||
|
|||||||
Reference in New Issue
Block a user