Skip to content

Commit 8fa9e36

Browse files
committed
Added nuget packaging
1 parent c5b6d20 commit 8fa9e36

File tree

7 files changed

+44
-14
lines changed

7 files changed

+44
-14
lines changed

appveyor.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ environment:
66
REPO_CLONE_TIMEOUT: 180
77
REPO_CLONE_PROTOCOL: https
88
buildconfig: Release
9-
nugetsprefix: Serilog.Sinks.Async.*
10-
symbolsourcekey: 8d3f700a-d75b-4261-97a4-0dca466f3991
119
matrix:
1210
- test_type: Unit.Testing
1311
test_assemblies: Serilog.Sinks.Async.UnitTests\bin\$env:buildconfig\Serilog.Sinks.Async.UnitTests.dll
@@ -27,12 +25,18 @@ init:
2725
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
2826
clone_script:
2927
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/clone-repo-retry.ps1'))
30-
install:
31-
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/mindkin/ci/master/AppVeyor/set-version-from-assemblyinformationalversion.ps1'))
3228
build_script:
3329
- cd src
3430
- msbuild.exe Serilog.Sinks.Async.sln /t:Rebuild /p:Configuration=%buildconfig% /verbosity:minimal
3531
- cd..
32+
after_build:
33+
- cd src
34+
- cd Serilog.Sinks.Async
35+
- ..\.nuget\nuget.exe pack Serilog.Sinks.Async.csproj -Symbols -IncludeReferencedProjects -Properties Configuration=%buildconfig%
36+
- cd..
37+
- cd..
38+
- appveyor PushArtifact src\Serilog.Sinks.Async\Serilog.Sinks.Async.1.0.0.nupkg
39+
- appveyor PushArtifact src\Serilog.Sinks.Async\Serilog.Sinks.Async.1.0.0.symbols.nupkg
3640
test_script:
3741
- ps: >-
3842
cd src
@@ -53,9 +57,8 @@ test_script:
5357
}
5458
5559
cd..
56-
after_test:
57-
- ps: |
58-
Get-ChildItem -Recurse .\$env:nugetsprefix.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
59-
Get-ChildItem -Recurse .\$env:nugetsprefix.symbols.nupkg | % { nuget push $_.FullName $env:symbolsourcekey -Source https://www.myget.org/F/jezzsantos/api/v2/package }
60-
deploy: off
61-
60+
deploy:
61+
provider: NuGet
62+
api_key:
63+
secure: n7CGF6VNSHInVFiFrCvq6RpdoBWjD7MLd6WeMa5Dn8lwlHgzPnX6PkT7CnnErb+N
64+
skip_symbols: false
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
$assemblyFile = "$env:APPVEYOR_BUILD_FOLDER\src\GlobalAssemblyInfo.cs"
2+
$regex = new-object System.Text.RegularExpressions.Regex ('(AssemblyInformationalVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
3+
[System.Text.RegularExpressions.RegexOptions]::MultiLine)
4+
$content = [IO.File]::ReadAllText($assemblyFile)
5+
$version = $null
6+
$match = $regex.Match($content)
7+
if($match.Success) {
8+
$version = $match.groups[3].value
9+
}
10+
11+
$version = "$version.$env:APPVEYOR_BUILD_NUMBER"
12+
Update-AppveyorBuild -Version $version

src/GlobalAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Runtime.InteropServices;
33

44
[assembly: AssemblyConfiguration("")]
5-
[assembly: AssemblyCompany("")]
5+
[assembly: AssemblyCompany("[email protected]")]
66
[assembly: AssemblyProduct("Serilog.Sinks.Async")]
77
[assembly: AssemblyCopyright("Copyright © 2016")]
88
[assembly: AssemblyTrademark("")]

src/Serilog.Sinks.Async/BufferedQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public async Task ConsumeAsync(Action<TMessage> action, CancellationToken cancel
6363
{
6464
action(message);
6565
}
66-
catch (Exception ex)
66+
catch (Exception)
6767
{
6868
//Log and Ignore exception and continue
6969
}

src/Serilog.Sinks.Async/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
using System.Runtime.InteropServices;
33

44
[assembly: AssemblyTitle("Serilog.Sinks.Async")]
5-
[assembly: AssemblyDescription("")]
5+
[assembly: AssemblyDescription("An async Serilog sink")]
66
[assembly: Guid("02106765-de7b-48c8-aa6e-79ebb435a6cd")]

src/Serilog.Sinks.Async/Serilog.Sinks.Async.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
</Reference>
4545
<Reference Include="System.Xml.Linq" />
4646
<Reference Include="System.Data.DataSetExtensions" />
47-
<Reference Include="Microsoft.CSharp" />
4847
<Reference Include="System.Data" />
4948
<Reference Include="System.Xml" />
5049
</ItemGroup>
@@ -59,6 +58,7 @@
5958
</ItemGroup>
6059
<ItemGroup>
6160
<None Include="packages.config" />
61+
<None Include="Serilog.Sinks.Async.nuspec" />
6262
</ItemGroup>
6363
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6464
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<authors>$author$</authors>
7+
<licenseUrl>https://github.com/jezzsantos/Serilog.Sinks.Async/blob/master/LICENSE</licenseUrl>
8+
<projectUrl>https://github.com/jezzsantos/Serilog.Sinks.Async</projectUrl>
9+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10+
<description>$description$</description>
11+
<releaseNotes>https://github.com/jezzsantos/Serilog.Sinks.Async/wiki/Release-Notes</releaseNotes>
12+
<copyright>Copyright © 2016</copyright>
13+
<tags>Serilog</tags>
14+
</metadata>
15+
</package>

0 commit comments

Comments
 (0)