Switch to bash

This commit is contained in:
Micah Lee 2022-05-29 11:45:34 -07:00
parent 2eee62c705
commit c9598a6e6d
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -104,20 +104,39 @@ jobs:
# Download cygwin
- run:
name: Download cygwin
shell: bash.exe --login -eo pipefail
command: |
if (((Test-Path C:\Users\circleci\build\libevent -PathType Container) -and (Test-Path C:\Users\circleci\build\tor -PathType Container)) -eq $true) {
Write-Output "libevent and tor already compiled, skipping"
} else {
Write-Output "downloading cygwin installer, signature, and signing key"
Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe -OutFile C:\Users\circleci\Downloads\setup-x86_64.exe
Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe.sig -OutFile C:\Users\circleci\Downloads\setup-x86_64.exe.sig
Invoke-WebRequest -Uri https://cygwin.com/key/pubring.asc -OutFile C:\Users\circleci\Downloads\pubring.asc
if [[ -d "/cygdrive/c/Users/circleci/build/libevent" ]]; then
if [[ -d "/cygdrive/c/Users/circleci/build/tor" ]]; then
echo "libevent and tor already compiled, skipping"
exit 0
fi
fi
Write-Output "verifying signature"
gpg --import C:\Users\circleci\Downloads\pubring.asc
gpg --verify C:\Users\circleci\Downloads\setup-x86_64.exe.sig C:\Users\circleci\Downloads\setup-x86_64.exe
if($? -ne $true) { throw "cygwin failed to verify" }
}
curl -o setup-x86_64.exe https://cygwin.com/setup-x86_64.exe
curl -o setup-x86_64.exe.sig https://cygwin.com/setup-x86_64.exe.sig
curl -o pubring.asc https://cygwin.com/key/pubring.asc
gpg --import pubring.asc
gpg --verify setup-x86_64.exe.sig setup-x86_64.exe
if [ $? -ne 0 ]; then
echo "cygwin signature doesn't verify"
exit -1
fi
# if (((Test-Path C:\Users\circleci\build\libevent -PathType Container) -and (Test-Path C:\Users\circleci\build\tor -PathType Container)) -eq $true) {
# Write-Output "libevent and tor already compiled, skipping"
# } else {
# Write-Output "downloading cygwin installer, signature, and signing key"
# Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe -OutFile C:\Users\circleci\Downloads\setup-x86_64.exe
# Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe.sig -OutFile C:\Users\circleci\Downloads\setup-x86_64.exe.sig
# Invoke-WebRequest -Uri https://cygwin.com/key/pubring.asc -OutFile C:\Users\circleci\Downloads\pubring.asc
# Write-Output "verifying signature"
# gpg --import C:\Users\circleci\Downloads\pubring.asc
# gpg --verify C:\Users\circleci\Downloads\setup-x86_64.exe.sig C:\Users\circleci\Downloads\setup-x86_64.exe
# if($? -ne $true) { throw "cygwin failed to verify" }
# }
# Install cygwin and required packages
- run:
@ -134,7 +153,7 @@ jobs:
name: Build libevent
shell: C:\\cygwin64\\bin\\bash.exe --login -eo pipefail
command: |
if [[ -d "/cygdrive/c/Users/circleci/build/openssl" ]]; then
if [[ -d "/cygdrive/c/Users/circleci/build/libevent" ]]; then
echo "libevent already compiled, skipping"
exit 0
fi