File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,27 @@ jobs:
129
129
shell : pwsh
130
130
if : runner.os == 'Windows'
131
131
run : |
132
- Start-BitsTransfer -Source https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${env:WASI_VERSION}/wasi-sdk-${env:WASI_VERSION_FULL}-x86_64-windows.tar.gz
132
+ $MaxRetries = 3
133
+ $RetryDelay = 10
134
+ $Attempt = 0
135
+ while ($Attempt -lt $MaxRetries) {
136
+ try {
137
+ Start-BitsTransfer -Source https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${env:WASI_VERSION}/wasi-sdk-${env:WASI_VERSION_FULL}-x86_64-windows.tar.gz
138
+ break
139
+ }
140
+ catch {
141
+ Write-Host "Error: $($_.Exception.Message)"
142
+ $Attempt++
143
+ if ($Attempt -lt $MaxRetries) {
144
+ Write-Host "Retrying in $RetryDelay seconds"
145
+ Start-Sleep -Seconds $RetryDelay
146
+ }
147
+ else {
148
+ Write-Host "Max retries reached. Download failed."
149
+ exit 1
150
+ }
151
+ }
152
+ }
133
153
New-Item -ItemType Directory -Path ${env:WASI_SDK_PATH}
134
154
tar -zxvf wasi-sdk-${env:WASI_VERSION_FULL}-x86_64-windows.tar.gz -C ${env:WASI_SDK_PATH} --strip 1
135
155
- name : Install Dependencies
You can’t perform that action at this time.
0 commit comments