From 8246fcb609c706d424eb7bb16b4ae06e156479b9 Mon Sep 17 00:00:00 2001 From: Rikki Tooley Date: Fri, 21 Nov 2014 00:01:39 +0000 Subject: [PATCH] Only use semantic versioning when packaging NuGet --- .nuget/pack.ps1 | 18 +++++++++++++++--- appveyor.yml | 7 ++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.nuget/pack.ps1 b/.nuget/pack.ps1 index b5ebabd..43189ac 100644 --- a/.nuget/pack.ps1 +++ b/.nuget/pack.ps1 @@ -1,12 +1,24 @@ +param( + [string] $versionSuffix +) + $root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..' $version = [System.Reflection.Assembly]::LoadFile("$root\src\IF.Lastfm.Core\bin\Release\IF.Lastfm.Core.dll").GetName().Version -$versionStr = $version.ToString() + +if ($versionSuffix) +{ + $versionStr = "{0}.{1}.{2}-{3}" -f ($version.Major, $version.Minor, $version.Build, $versionSuffix) +} +else +{ + $versionStr = $version.ToString() +} Write-Host "Setting .nuspec version tag to $versionStr" $content = (Get-Content $root\.nuget\IF.Lastfm.nuspec) $content = $content -replace '\$version',$versionStr -$content | Out-File $root\.nuget\IF.Lastfm.compiled.nuspec +$content | Out-File $root\.nuget\IF.Lastfm.$versionStr.compiled.nuspec -& $root\.nuget\NuGet.exe pack $root\.nuget\IF.Lastfm.compiled.nuspec \ No newline at end of file +& $root\.nuget\NuGet.exe pack $root\.nuget\IF.Lastfm.$versionStr.compiled.nuspec \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 6c0950c..0931634 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ only: - master - version: 0.2.0.{build}-prerelease + version: 0.2.0.{build} assembly_info: patch: true @@ -21,12 +21,12 @@ project: IF.Lastfm.sln after_test: - - ps: .nuget\pack.ps1 + - ps: .nuget\pack.ps1 -versionSuffix prerelease artifacts: - path: src\IF.Lastfm.Core\bin\Release\IF.Lastfm.Core.dll name: IF.Lastfm.Core.dll - - path: '**\*.nupkg' + - path: '**\*-prerelease.nupkg' nuget: project_feed: true @@ -36,6 +36,7 @@ only: - release + # don't forget to update this! version: 0.1.2.{build} assembly_info: