From 34166b5e63c79b414767349bc0c24efa9d516fd2 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sat, 16 Nov 2024 23:04:06 +0000 Subject: [PATCH] Update appveyor.yml (#36) Co-authored-by: gstraccini[bot] <150967461+gstraccini[bot]@users.noreply.github.com> --- 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%