From 04c8cdbb20d9bc845e39a3e1791d13587ba0c648 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Tue, 2 Aug 2016 14:48:46 -0700 Subject: [PATCH] Be smarter about nuget package names on appveyor --- appveyor.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index fd70a0c58..071ae8d5d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -93,7 +93,18 @@ on_finish: $artifacts.Add($zipFilePath) $artifacts.Add($zipFileFullPath) - Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix "b$($env:APPVEYOR_BUILD_NUMBER)" + if ($env:APPVEYOR_REPO_TAG_NAME) + { + # ignore the first part of semver, use the preview part + $preReleaseVersion = ($env:APPVEYOR_REPO_TAG_NAME).Split('-')[1] + } + else + { + $previewLabel = (git describe --abbrev=0).Split('-')[1] + $preReleaseVersion = "$previewLabel.$($env:APPVEYOR_BUILD_NUMBER)" + } + + Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix $preReleaseVersion $artifacts += (ls .\nuget-artifacts | % {$_.FullName})