Skip to content

Commit

Permalink
ci(win): workaround for broken curl 8.8.0 --write-out opt in latest w…
Browse files Browse the repository at this point in the history
…in runner update
  • Loading branch information
YOU54F committed Jun 9, 2024
1 parent 13cf384 commit c6e93df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
macos-14,
macos-12,
ubuntu-latest,
# windows-latest
windows-latest
]

env:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
macos-14,
macos-12,
ubuntu-latest,
# windows-latest
windows-latest
]
env:
NODE_VERSION: ${{ matrix.node-version }}
Expand Down
14 changes: 13 additions & 1 deletion script/lib/download-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ function download_to {
OUTPUT_FILE="$2"
debug_log "doing curl of: '$URL', saving in $OUTPUT_FILE"

HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
if [[ "$(uname -m)" == "Darwin" ]] || [[ "$(uname -m)" == "Linux" ]]; then
HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
else
# temp workaround for curl 8.8.x error on windows gha runners
# https:/curl/curl/issues/13845
curl --silent --output "$OUTPUT_FILE" --location "$URL"
if [ $? -ne 0 ]; then
error "Unable to download file at url ${URL}"
exit 1
else
HTTP_CODE=200
fi
fi
debug_log "did curl, http code was '${HTTP_CODE}'"
if [[ "${HTTP_CODE}" -lt 200 || "${HTTP_CODE}" -gt 299 ]] ; then
error "Unable to download file at url ${URL}"
Expand Down

0 comments on commit c6e93df

Please sign in to comment.