Skip to content

Commit

Permalink
use Nerdbank.GitVersioning to automate generation of assembly and nug…
Browse files Browse the repository at this point in the history
…et package versions
  • Loading branch information
AndrewKostousov committed Sep 13, 2018
1 parent c6d62e9 commit 2e615cc
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

## v2.3 - 2018.09.13
- Use [Nerdbank.GitVersioning](https://github.com/AArnott/Nerdbank.GitVersioning) to automate generation of assembly
and nuget package versions.

## v2.2 - 2018.01.01
- Support .NET Standard 2.0 ([PR#9](https://github.com/skbkontur/gremit/pull/9)
by [@Amartel1986](https://github.com/Amartel1986)).
- Switch to SDK-style project format and dotnet core build tooling.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="All" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,17 @@
</ItemGroup>
</Target>

<Target Name="SetNuSpecProperties" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion">
<PropertyGroup>
<PackageId>$(AssemblyName)</PackageId>
<Authors>Igor Chevdar</Authors>
<PackageTags>.NET Reflection Emit ILGenerator</PackageTags>
<Description>GrEmit is a library containing different helpers for generating code using Reflection.Emit with the main one being GroboIL - a smart wrapper over ILGenerator.</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/skbkontur/gremit</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<PackageReleaseNotes>$(RepositoryUrl)/releases/tag/v$(MajorMinorVersion)-release</PackageReleaseNotes>
</PropertyGroup>
</Target>

</Project>
10 changes: 0 additions & 10 deletions GrEmit/GrEmit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1705;1591</NoWarn>
<PackageId>GrEmit</PackageId>
<VersionPrefix>2.2.3</VersionPrefix>
<Version>$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<Authors>Igor Chevdar</Authors>
<PackageTags>.NET Reflection Emit ILGenerator</PackageTags>
<Description>GrEmit is a library containing different helpers for generating code using Reflection.Emit with the main one being GroboIL - a smart wrapper over ILGenerator.</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/skbkontur/gremit</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ notNull_0: // [{Object: IList, IList<T>, IReadOnlyList<T>}]
// [Int32]
ret // []
```

## Release Notes

See [CHANGELOG](CHANGELOG.md).
44 changes: 44 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
version: '{build}'

skip_commits:
files:
- '**/*.md'

image: Visual Studio 2017

init:
- cmd: git config --global core.autocrlf false
- ps: |
$ErrorActionPreference = "Stop"
$tagName = $env:APPVEYOR_REPO_TAG_NAME
if ($tagName -match '^v\d+\.\d+') # tag name starts with 'vX.Y'
{
$env:SHOULD_PUBLISH_NUGET_PACKAGE = "true"
Write-Host "Will publish nuget package for $tagName tag" -ForegroundColor "Green"
if ($tagName -match '^v\d+\.\d+-release$') # tag name matches 'vX.Y-release'
{
$env:SHOULD_CREATE_RELEASE = "true"
Write-Host "Will create release for $tagName tag" -ForegroundColor "Green"
}
}
nuget:
disable_publish_on_pr: true

before_build:
- cmd: dotnet --info
- cmd: dotnet restore ./GrEmit.sln --verbosity m

build_script:
- cmd: dotnet build --configuration Release ./GrEmit.sln
- cmd: dotnet pack --no-build --configuration Release ./GrEmit.sln

test_script:
- cmd: dotnet test --no-build --configuration Release ./GrEmit.Tests/GrEmit.Tests.csproj

artifacts:
- path: './GrEmit/bin/Release/*.nupkg'

deploy:
- provider: NuGet
server: https://nuget.org
api_key:
secure: dzTnT0xSlPrHnrG06cj354nTN4lXWhfh4ZCJ1910I3VnNdvbx0rQFLTyJ5l1+bgB
skip_symbols: true
on:
SHOULD_PUBLISH_NUGET_PACKAGE: true

- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: y8dDOcAtq4U1MTDJFX8f23xsvyFU1u4bhwr9Lzbkf2revNWPPTifBkWghris9v8i
draft: false
prerelease: false
on:
SHOULD_CREATE_RELEASE: true
17 changes: 17 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.3",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/tags/v\\d+\\.\\d+"
],
"nugetPackageVersion": {
"semVer": 2
},
"cloudBuild": {
"setVersionVariables": true,
"buildNumber": {
"enabled": false
}
}
}

0 comments on commit 2e615cc

Please sign in to comment.