2014-11-21 00:01:39 +00:00
|
|
|
param(
|
|
|
|
[string] $versionSuffix
|
|
|
|
)
|
|
|
|
|
2015-04-25 15:31:50 +01:00
|
|
|
function CompileNuspec([string]$dllPath, [string]$nuspecname)
|
2014-11-21 00:01:39 +00:00
|
|
|
{
|
2015-04-26 18:30:08 +01:00
|
|
|
Write-Host "Setting $nuspecname .nuspec version tag to $versionStr" -Foreground green
|
2014-11-20 23:27:39 +00:00
|
|
|
|
2015-04-25 15:31:50 +01:00
|
|
|
$content = (Get-Content $root\.nuget\$nuspecname.nuspec)
|
|
|
|
$content = $content -replace '\$version',$versionStr
|
|
|
|
|
2015-04-26 18:30:08 +01:00
|
|
|
$content | Out-File "$root\.nuget\$nuspecname.$versionStr.compiled.nuspec"
|
2015-04-25 15:31:50 +01:00
|
|
|
|
2015-04-26 18:30:08 +01:00
|
|
|
& $root\.nuget\NuGet.exe pack "$root\.nuget\$nuspecname.$versionStr.compiled.nuspec"
|
2015-04-25 15:31:50 +01:00
|
|
|
}
|
2014-11-20 23:27:39 +00:00
|
|
|
|
2015-05-01 10:50:01 +01:00
|
|
|
. ".\Package-Versions.ps1"
|
|
|
|
|
|
|
|
$root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..'
|
|
|
|
|
2018-04-23 03:23:49 +01:00
|
|
|
$dllPath = "$root\src\IF.Lastfm.Core\bin\Release\netstandard1.1\IF.Lastfm.Core.dll"
|
2015-05-01 10:50:01 +01:00
|
|
|
$version = [System.Reflection.AssemblyName]::GetAssemblyName($dllPath).Version
|
|
|
|
|
|
|
|
if ($versionSuffix) {
|
|
|
|
$versionStr = "{0}.{1}.{2}-{3}" -f ($version.Major, $version.Minor, $version.Build, $versionSuffix)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$versionStr = $version.ToString()
|
|
|
|
}
|
|
|
|
|
|
|
|
CompileNuspec $dllPath "Inflatable.Lastfm"
|
2015-04-26 18:30:08 +01:00
|
|
|
|
|
|
|
if ([string]::IsNullOrEmpty($sqliteVersion)){
|
|
|
|
Write-Host "Couldn't read version to use for SQLite package" -Foreground red
|
|
|
|
}
|
|
|
|
else {
|
2015-10-11 22:00:34 +01:00
|
|
|
if ($versionStr.endswith("prerelease") -or $versionStr.startswith($sqliteVersion)) {
|
2018-04-23 03:23:49 +01:00
|
|
|
CompileNuspec "$root\src\IF.Lastfm.SQLite\bin\Release\netstandard1.1\IF.Lastfm.SQLite.dll" "Inflatable.Lastfm.SQLite"
|
2015-04-26 18:30:08 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
Write-Host "Skipping SQLite package, build version is not $sqliteVersion" -Foreground yellow
|
|
|
|
}
|
|
|
|
}
|
2014-11-21 01:13:40 +00:00
|
|
|
|
2014-12-08 10:49:03 +00:00
|
|
|
# publish to appveyor feeds //TODO fix this
|
2015-04-26 18:30:08 +01:00
|
|
|
# appveyor PushArtifact Inflatable.Lastfm.$versionStr.nupkg
|