Skip to content

Commit 4030dee

Browse files
committed
using GitHub Tags instead of Releases for ver calculation in AppVeyor
1 parent 353e495 commit 4030dee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ init:
2626
- ps: |
2727
$env:VERSION_INFORMATIONAL = $env:APPVEYOR_BUILD_VERSION
2828
$env:VERSION_SIMPLE = "$env:APPVEYOR_BUILD_VERSION.$env:APPVEYOR_BUILD_NUMBER"
29-
$env:GITHUB_REPO_API = "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases/latest"
29+
$env:GITHUB_REPO_API = "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/tags"
3030
3131
if ($env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_REPO_TAG_NAME) {
3232
### CHECK IF A IT'S A TAGGED BUILD
@@ -41,8 +41,8 @@ init:
4141
try {
4242
### TRY TO GET VERSION FROM THE LATEST GITHUB TAG/REALEASE
4343
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
44-
$github_last_release=(Invoke-WebRequest -Uri $env:GITHUB_REPO_API) -join '`n' | ConvertFrom-Json
45-
$github_last_tag=$github_last_release.tag_name.TrimStart("v")
44+
$github_latest_tags=(Invoke-WebRequest -Uri $env:GITHUB_REPO_API) -join '`n' | ConvertFrom-Json
45+
$github_last_tag=$github_latest_tags[0].name.TrimStart("v")
4646
if ($github_last_tag -match '^([0-9]+\.[0-9]+\.[0-9]+)$') {
4747
$github_tag_ver = [version]$github_last_tag
4848
$github_last_tag = "{0}.{1}.{2}" -f $github_tag_ver.Major, $github_tag_ver.Minor, ($github_tag_ver.Build + 1)

0 commit comments

Comments
 (0)