| @@ -25,25 +25,28 @@ init: | |||||
| build_script: | build_script: | ||||
| - ps: >- | - ps: >- | ||||
| if ($isLinux) { | |||||
| if ($isLinux) | |||||
| { | |||||
| # AppVeyor Linux images do not have appveyor-retry, which retries the commands a few times | # AppVeyor Linux images do not have appveyor-retry, which retries the commands a few times | ||||
| # until the command exits with code 0. | # until the command exits with code 0. | ||||
| # So, this is done with a short script. | # So, this is done with a short script. | ||||
| $code = 0 | $code = 0 | ||||
| $counter = 0 | $counter = 0 | ||||
| do { | |||||
| do | |||||
| { | |||||
| dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | ||||
| $code = $LASTEXITCODE | $code = $LASTEXITCODE | ||||
| $counter++ | $counter++ | ||||
| if ($code -ne 0) | if ($code -ne 0) | ||||
| { | { | ||||
| # Wait 5s before attempting to run again | # Wait 5s before attempting to run again | ||||
| Start-sleep -Seconds 5 | Start-sleep -Seconds 5 | ||||
| } | } | ||||
| } until ($counter -eq 5 -or $code -eq 0) | |||||
| } else { | |||||
| } | |||||
| until ($counter -eq 5 -or $code -eq 0) | |||||
| } | |||||
| else | |||||
| { | |||||
| appveyor-retry dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | appveyor-retry dotnet restore Discord.Net.sln -v Minimal /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | ||||
| } | } | ||||
| - ps: dotnet build Discord.Net.sln -c "Release" /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | - ps: dotnet build Discord.Net.sln -c "Release" /p:BuildNumber="$Env:BUILD" /p:IsTagBuild="$Env:APPVEYOR_REPO_TAG" | ||||