Skip to content

Commit

Permalink
ci: fix windows pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Oct 4, 2024
1 parent b08af58 commit 18f60c7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/install-all-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e

here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

os_name="$1"

# shellcheck source=.github/scripts/install-openssl.sh
source "$here/install-openssl.sh" "$os_name"
# shellcheck source=.github/scripts/install-proto.sh
source "$here/install-proto.sh" "$os_name"
17 changes: 17 additions & 0 deletions .github/scripts/install-openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

os_name="$1"

case "$os_name" in
"Windows")
choco install openssl --install-arguments="'/DIR=C:\OpenSSL'"
export OPENSSL_DIR="C:\OpenSSL"
;;
"macOS") ;;
"Linux") ;;
*)
echo "Unknown Operating System"
;;
esac
2 changes: 0 additions & 2 deletions ...hub/scripts/cargo-clippy-before-script.sh → .github/scripts/install-proto.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ os_name="$1"

case "$os_name" in
"Windows")
vcpkg install openssl:x64-windows-static-md
vcpkg integrate install
choco install protoc
export PROTOC='C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe'
;;
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ jobs:
with:
version: "v0.8.1"

- shell: bash
run: .github/scripts/cargo-clippy-before-script.sh ${{ runner.os }}

- shell: bash
run: |
source .github/scripts/install-all-deps.sh ${{ runner.os }}
source ci/rust-version.sh nightly
rustup component add clippy --toolchain "$rust_nightly"
scripts/cargo-clippy-nightly.sh
5 changes: 1 addition & 4 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ jobs:
id: build
shell: bash
run: |
vcpkg install openssl:x64-windows-static-md
vcpkg integrate install
choco install protoc
export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe"
source .github/scripts/install-all-deps.sh ${{ runner.os }}
source /tmp/env.sh
echo "tag=$CI_TAG" >> $GITHUB_OUTPUT
eval "$(ci/channel-info.sh)"
Expand Down

0 comments on commit 18f60c7

Please sign in to comment.