Skip to content

Commit 33e6a59

Browse files
committed
resetting AppVeyor's build number upon tagged build completion
1 parent 2950764 commit 33e6a59

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

appveyor.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ environment:
2121
VERSION_SIMPLE: '{version}'
2222
VERSION_INFORMATIONAL: '{version}'
2323
VERSION_UNSTABLE_SUFFIX: '-preview-$(APPVEYOR_BUILD_NUMBER)'
24+
APPVEYOR_TOKEN:
25+
secure: LtoVAPATN9iTCl1zkCvEktqP92QSEEngyS3vqG3GphE=
2426

2527
init:
2628
- ps: |
@@ -119,6 +121,23 @@ deploy:
119121
secure: 3zmnmVBweTgdk4SBM/rWHdC9JOM9s0pxm1bw1d+WHDo=
120122
artifact: NuGet_Files
121123

124+
125+
after_deploy:
126+
- ps: |
127+
if ($env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_REPO_TAG_NAME) {
128+
$apiUrl = 'https://ci.appveyor.com/api'
129+
$headers = @{
130+
"Authorization" = "Bearer $env:APPVEYOR_TOKEN"
131+
"Content-type" = "application/json"
132+
"Accept" = "application/json"
133+
}
134+
$build = @{
135+
nextBuildNumber = 1
136+
}
137+
$json = $build | ConvertTo-Json
138+
Invoke-RestMethod -Method Put "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/settings/build-number" -Body $json -Headers $headers
139+
}
140+
122141
# Start builds on tags only (GitHub and BitBucket)
123142
skip_non_tags: false
124143

0 commit comments

Comments
 (0)