mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
Only use semantic versioning when packaging NuGet
This commit is contained in:
parent
f5db4b37eb
commit
8246fcb609
@ -1,12 +1,24 @@
|
|||||||
|
param(
|
||||||
|
[string] $versionSuffix
|
||||||
|
)
|
||||||
|
|
||||||
$root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..'
|
$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
|
$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"
|
Write-Host "Setting .nuspec version tag to $versionStr"
|
||||||
|
|
||||||
$content = (Get-Content $root\.nuget\IF.Lastfm.nuspec)
|
$content = (Get-Content $root\.nuget\IF.Lastfm.nuspec)
|
||||||
$content = $content -replace '\$version',$versionStr
|
$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
|
& $root\.nuget\NuGet.exe pack $root\.nuget\IF.Lastfm.$versionStr.compiled.nuspec
|
@ -3,7 +3,7 @@
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
version: 0.2.0.{build}-prerelease
|
version: 0.2.0.{build}
|
||||||
|
|
||||||
assembly_info:
|
assembly_info:
|
||||||
patch: true
|
patch: true
|
||||||
@ -21,12 +21,12 @@
|
|||||||
project: IF.Lastfm.sln
|
project: IF.Lastfm.sln
|
||||||
|
|
||||||
after_test:
|
after_test:
|
||||||
- ps: .nuget\pack.ps1
|
- ps: .nuget\pack.ps1 -versionSuffix prerelease
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: src\IF.Lastfm.Core\bin\Release\IF.Lastfm.Core.dll
|
- path: src\IF.Lastfm.Core\bin\Release\IF.Lastfm.Core.dll
|
||||||
name: IF.Lastfm.Core.dll
|
name: IF.Lastfm.Core.dll
|
||||||
- path: '**\*.nupkg'
|
- path: '**\*-prerelease.nupkg'
|
||||||
|
|
||||||
nuget:
|
nuget:
|
||||||
project_feed: true
|
project_feed: true
|
||||||
@ -36,6 +36,7 @@
|
|||||||
only:
|
only:
|
||||||
- release
|
- release
|
||||||
|
|
||||||
|
# don't forget to update this!
|
||||||
version: 0.1.2.{build}
|
version: 0.1.2.{build}
|
||||||
|
|
||||||
assembly_info:
|
assembly_info:
|
||||||
|
Loading…
Reference in New Issue
Block a user