Auto versioning with NB.GV

This commit is contained in:
Oren Novotny 2018-02-01 20:15:31 -05:00
parent 286d0e4c44
commit 47a7a4bcf1
No known key found for this signature in database
GPG Key ID: D501F3955648A88A
4 changed files with 30 additions and 9 deletions

View File

@ -13,7 +13,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ben.Demystifier.Test", "tes
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{455921D3-DD54-4355-85CF-F4009DF2AB70}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{455921D3-DD54-4355-85CF-F4009DF2AB70}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackTrace", "sample\StackTrace\StackTrace.csproj", "{E161FC12-53C2-47CD-A5FC-3684B86723A9}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackTrace", "sample\StackTrace\StackTrace.csproj", "{E161FC12-53C2-47CD-A5FC-3684B86723A9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5937ACDF-0059-488E-9604-D84689C72933}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
build.ps1 = build.ps1
directory.build.props = directory.build.props
version.json = version.json
EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -22,11 +22,6 @@ function Exec
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
exec { & dotnet restore }
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
exec { & dotnet test .\test\Ben.Demystifier.Test -c Release } exec { & dotnet test .\test\Ben.Demystifier.Test -c Release }
exec { & dotnet pack .\src\Ben.Demystifier -c Release -o .\artifacts --version-suffix=$revision } exec { & dotnet pack .\src\Ben.Demystifier -c Release -o .\artifacts }

View File

@ -9,9 +9,8 @@
<PackageProjectUrl>https://github.com/benaadams/Ben.Demystifier</PackageProjectUrl> <PackageProjectUrl>https://github.com/benaadams/Ben.Demystifier</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/benaadams/Ben.Demystifier/blob/master/LICENSE</PackageLicenseUrl> <PackageLicenseUrl>https://github.com/benaadams/Ben.Demystifier/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource> <IncludeSource>true</IncludeSource>
<Version>0.0.7</Version> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -19,6 +18,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.1.17" PrivateAssets="all" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.7.6" PrivateAssets="all" />
<PackageReference Include="System.Reflection.Metadata"> <PackageReference Include="System.Reflection.Metadata">
<Version>1.5.0</Version> <Version>1.5.0</Version>
</PackageReference> </PackageReference>

17
version.json Normal file
View File

@ -0,0 +1,17 @@
{
"version": "0.0",
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/heads/dev$", // we release out of develop
"^refs/tags/v\\d+\\.\\d+" // we also release tags starting with vN.N
],
"nugetPackageVersion":{
"semVer": 2
},
"cloudBuild": {
"buildNumber": {
"enabled": true,
"setVersionVariables": true
}
}
}