IF.Lastfm/.nuget/pack.ps1
Rikki Tooley 0bb5529365 Publish NuGet packages to AppVeyor feeds
nuget property in appveyor.yml adds the feeds to NuGet's sources, doesn't publish to them
2014-11-21 01:14:34 +00:00

27 lines
812 B
PowerShell

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
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.$versionStr.compiled.nuspec
& $root\.nuget\NuGet.exe pack $root\.nuget\IF.Lastfm.$versionStr.compiled.nuspec
# publish to appveyor feeds
appveyor PushArtifact IF.Lastfm.$versionStr.nupkg