From c6e93df6e4a27f9a9d9c15c3bb0af35cafe43aa4 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Sun, 9 Jun 2024 03:41:57 +0100 Subject: [PATCH] ci(win): workaround for broken curl 8.8.0 --write-out opt in latest win runner update --- .github/workflows/build-and-test.yml | 4 ++-- script/lib/download-file.sh | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a9dbfef5..49d4bb18 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -33,7 +33,7 @@ jobs: macos-14, macos-12, ubuntu-latest, - # windows-latest + windows-latest ] env: @@ -88,7 +88,7 @@ jobs: macos-14, macos-12, ubuntu-latest, - # windows-latest + windows-latest ] env: NODE_VERSION: ${{ matrix.node-version }} diff --git a/script/lib/download-file.sh b/script/lib/download-file.sh index 0640a0ea..87110c34 100644 --- a/script/lib/download-file.sh +++ b/script/lib/download-file.sh @@ -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://github.com/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}"