From 46fdb8315f708aeb060c3db9f8810ec4f32585a9 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sat, 16 Nov 2024 22:37:24 +0000 Subject: [PATCH] Update appveyor.yml --- appveyor.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index e678141..19f5181 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,17 @@ version: 4.0.{build} skip_tags: true image: Visual Studio 2022 +install: + # If a newer build is queued for the same PR, cancel this one. + # The AppVeyor 'rollout builds' option is supposed to serve the same + # purpose, but it is problematic because it tends to cancel builds pushed + # directly to main/master instead of just PR builds (or the converse). + # credits: JuliaLang developers. + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + build_script: - cmd: nuget pack MSBuild.Version.Target.nuspec -Version %APPVEYOR_BUILD_VERSION%