Skip to content

Commit 0367996

Browse files
committed
Retry curl transfer failures
1 parent 382490c commit 0367996

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ runs:
106106
# translate swift-version "latest" into our known latest version
107107
if [ "${{ inputs.swift-version }}" == 'latest' ]; then
108108
# fetch the most recent release tag from the toolchain repo
109-
#LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" --retry-all-errors --retry 100 --retry-max-time 600 https://api.github.com/repos/skiptools/swift-android-toolchain/releases/latest | jq -r '.tag_name')
109+
#LATEST_TAG=$(curl -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" --retry 10 --retry-max-time 600 https://api.github.com/repos/skiptools/swift-android-toolchain/releases/latest | jq -r '.tag_name')
110110
# disabled because it frequently gives "The requested URL returned error: 403"
111111
LATEST_TAG="6.0.3"
112112
echo "swift-version=${LATEST_TAG}" >> $GITHUB_OUTPUT
@@ -129,9 +129,9 @@ runs:
129129
mkdir -p ~/swift-download
130130
cd ~/swift-download
131131
if [ ${RUNNER_OS} == 'Linux' ]; then
132-
curl -fsSL --retry 8 --retry-all-errors https://download.swift.org/swift-${{ steps.setup.outputs.swift-version }}-release/${{ steps.setup.outputs.osid }}/${SWIFT_ID}/${SWIFT_ID}-${{ steps.setup.outputs.osidpair }}.tar.gz --output swift.tar.gz
132+
curl -fsSL --retry 8 --retry-connrefused https://download.swift.org/swift-${{ steps.setup.outputs.swift-version }}-release/${{ steps.setup.outputs.osid }}/${SWIFT_ID}/${SWIFT_ID}-${{ steps.setup.outputs.osidpair }}.tar.gz --output swift.tar.gz
133133
elif [ ${RUNNER_OS} == 'macOS' ]; then
134-
curl -fsSL --retry 8 --retry-all-errors https://download.swift.org/swift-${{ steps.setup.outputs.swift-version }}-release/xcode/${SWIFT_ID}/${SWIFT_ID}-osx.pkg --output swift.pkg
134+
curl -fsSL --retry 8 --retry-connrefused https://download.swift.org/swift-${{ steps.setup.outputs.swift-version }}-release/xcode/${SWIFT_ID}/${SWIFT_ID}-osx.pkg --output swift.pkg
135135
else
136136
echo "::error::Unsupported platform: ${RUNNER_OS}"
137137
exit 1
@@ -178,7 +178,7 @@ runs:
178178
179179
mkdir -p ${RUNNER_TEMP}/swift-android-toolchain
180180
cd ${RUNNER_TEMP}/swift-android-toolchain
181-
curl -fsSL --retry 8 --retry-all-errors https://github.com/skiptools/swift-android-toolchain/releases/download/${{ steps.setup.outputs.swift-version }}/${SWIFT_SDK_ID}.artifactbundle.tar.gz --output ${SWIFT_SDK_ID}.artifactbundle.tar.gz
181+
curl -fsSL --retry 8 --retry-connrefused https://github.com/skiptools/swift-android-toolchain/releases/download/${{ steps.setup.outputs.swift-version }}/${SWIFT_SDK_ID}.artifactbundle.tar.gz --output ${SWIFT_SDK_ID}.artifactbundle.tar.gz
182182
183183
# first check if it already installed (we may be running this workflow multiple times for an action, in which case it will already be present)
184184
${SWIFT_INSTALLATION}/bin/swift sdk configure --show-configuration ${SWIFT_SDK_ID} ${SWIFT_SDK_TARGET} &> /dev/null || ${SWIFT_INSTALLATION}/bin/swift sdk install ${SWIFT_SDK_ID}.artifactbundle.tar.gz

0 commit comments

Comments
 (0)