diff --git a/build.ps1 b/build.ps1 index 111dabbe6..b39b817cf 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,10 +1,10 @@ if (Test-Path Env:\APPVEYOR_BUILD_NUMBER) { - $build = [convert]::ToInt32($env:APPVEYOR_BUILD_NUMBER).ToString("00000") + $build = $env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0") } else { $build = "dev" } -dotnet restore Discord.Net.sln +appveyor-retry dotnet restore Discord.Net.sln -v Minimal -p:BuildNumber="$build" if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } dotnet build Discord.Net.sln -c "Release" -p:BuildNumber="$build" if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } \ No newline at end of file diff --git a/pack.ps1 b/pack.ps1 index d3d7e5679..531623a30 100644 --- a/pack.ps1 +++ b/pack.ps1 @@ -1,5 +1,5 @@ if (Test-Path Env:\APPVEYOR_BUILD_NUMBER) { - $build = [convert]::ToInt32($env:APPVEYOR_BUILD_NUMBER).ToString("00000") + $build = $env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0") } else { $build = "dev" } diff --git a/test.ps1 b/test.ps1 index dbf15abc9..98df9469d 100644 --- a/test.ps1 +++ b/test.ps1 @@ -1,2 +1,8 @@ +if (Test-Path Env:\APPVEYOR_BUILD_NUMBER) { + $build = $env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0") +} else { + $build = "dev" +} + dotnet test test/Discord.Net.Tests/Discord.Net.Tests.csproj -c "Release" --noBuild -p:BuildNumber="$build" if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } \ No newline at end of file