Skip to content

Commit 2777d7e

Browse files
Dependency & Build updates (#158)
Bump Microsoft.Extensions.Logging from 3.0.0 to 5.0.0 Bump Microsoft.Extensions.Logging.Console from 3.0.0 to 5.0.0 Bump Microsoft.Extensions.DependencyInjection from 3.0.0 to 5.0.0 Bump SonarAnalyzer.CSharp from 8.0.0.9566 to 8.15.0.24505 Bump Microsoft.NET.Test.Sdk from 16.2.0 to 16.8.0 Bump Microsoft.CodeAnalysis.FxCopAnalyzers from 2.9.7 to 3.3.1 Bump Polly from 6.1.2 to 7.2.1 Update builds to better support master to main branch rename.
1 parent a151b4d commit 2777d7e

File tree

11 files changed

+62
-92
lines changed

11 files changed

+62
-92
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,62 @@ jobs:
1212
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
1313

1414
steps:
15-
1615
- name: Checkout
1716
uses: actions/checkout@master
17+
with:
18+
fetch-depth: 0
1819

1920
- name: Extract branch name
2021
id: extract_branch
2122
shell: powershell
2223
run: Write-Host ([string]::Format("##[set-output name=branch;]{0}", $env:GITHUB_REF.Replace("refs/heads/", "")))
24+
25+
- name: Install GitVersion
26+
uses: gittools/actions/gitversion/setup@v0.9.7
27+
with:
28+
versionSpec: '5.5.1'
29+
30+
- name: Determine Version
31+
id: gitversion
32+
uses: gittools/actions/gitversion/execute@v0.9.7
33+
with:
34+
useConfigFile: true
35+
36+
- name: Install NuGet client
37+
uses: nuget/setup-nuget@v1
38+
with:
39+
nuget-version: '5.x'
2340

2441
- name: Run the Cake script
2542
id: cake
26-
uses: ecampidoglio/cake-action@master
43+
uses: cake-build/cake-action@master
2744
with:
2845
cake-bootstrap: true
29-
30-
- name: Install NuGet client
31-
uses: warrenbuckley/Setup-Nuget@v1
46+
verbosity: Diagnostic
47+
arguments: |
48+
fullSemVer: ${{steps.gitversion.outputs.fullSemVer}}
49+
assemblySemVer: ${{steps.gitversion.outputs.assemblySemVer}}
50+
informationalVersion: ${{steps.gitversion.outputs.informationalVersion}}
3251
3352
- name: Add private GitHub registry to NuGet
3453
run: nuget sources add -name "GPR" -Source https://nuget.pkg.github.com/dustinchilson/index.json -Username dustinchilson -Password ${{ secrets.GITHUB_TOKEN }}
3554

3655
- name: Push generated package to GitHub registry
37-
run: nuget push ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg -Source "GPR" -SkipDuplicate
56+
run: nuget push ./artifacts/NLog.Targets.GraylogHttp.${{steps.gitversion.outputs.fullSemVer}}.nupkg -Source "GPR" -SkipDuplicate
3857

3958
- name: Push generated package to nuget.org
4059
if: steps.extract_branch.outputs.branch == 'main'
41-
run: nuget push ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg -ApiKey ${{ secrets.NUGET_ORG_API_KEY }} -Source https://api.nuget.org/v3/index.json
60+
run: nuget push ./artifacts/NLog.Targets.GraylogHttp.${{steps.gitversion.outputs.fullSemVer}}.nupkg -ApiKey ${{secrets.NUGET_ORG_API_KEY}} -Source https://api.nuget.org/v3/index.json
4261

4362
- name: Create Release
4463
if: steps.extract_branch.outputs.branch == 'main'
4564
id: create_release
4665
uses: actions/create-release@master
4766
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4968
with:
50-
tag_name: v${{ env.GIT_VERSION }}
51-
release_name: Release v${{ env.GIT_VERSION }}
69+
tag_name: v${{steps.gitversion.outputs.fullSemVer}}
70+
release_name: Release v${{steps.gitversion.outputs.fullSemVer}}
5271
draft: false
5372
prerelease: false
54-
55-
- name: Upload Test Results
56-
if: steps.extract_branch.outputs.branch == 'main'
57-
id: upload-test-results
58-
uses: actions/upload-release-asset@master
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
with:
62-
upload_url: ${{ steps.create_release.outputs.upload_url }}
63-
asset_path: ./artifacts/TestResults.xml
64-
asset_name: TestResults.xml
65-
asset_content_type: application/xml
66-
67-
- name: Upload Nuget Package
68-
if: steps.extract_branch.outputs.branch == 'main'
69-
id: upload-nuget-package
70-
uses: actions/upload-release-asset@master
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
with:
74-
upload_url: ${{ steps.create_release.outputs.upload_url }}
75-
asset_path: ./artifacts/NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg
76-
asset_name: NLog.Targets.GraylogHttp.${{ env.GIT_VERSION }}.nupkg
77-
asset_content_type: application/xml
73+
body: https://www.nuget.org/packages/NLog.Targets.GraylogHttp/${{steps.gitversion.outputs.fullSemVer}}

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="all" />
26+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="all" />
2727
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
28-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.0.0.9566" PrivateAssets="all" />
28+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.15.0.24505" PrivateAssets="all" />
2929
</ItemGroup>
3030

3131
</Project>

GitVersion.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 1.0
1+
next-version: 2.0
22

33
assembly-versioning-scheme: MajorMinor
44
commit-message-incrementing: Disabled
@@ -7,4 +7,4 @@ continuous-delivery-fallback-tag: ''
77
mode: ContinuousDeployment
88

99
ignore:
10-
sha: []
10+
sha: []

NLog.Targets.GraylogHttp.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.14
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30320.27
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLog.Targets.GraylogHttp", "src\NLog.Targets.GraylogHttp\NLog.Targets.GraylogHttp.csproj", "{2DA00B6B-A170-419D-AD82-AC139745A11E}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{7970F18F-82A6-4B1C-B2D0-00F440E949F4}"
99
ProjectSection(SolutionItems) = preProject
1010
.gitignore = .gitignore
1111
after.NLog.Targets.GraylogHttp.sln.targets = after.NLog.Targets.GraylogHttp.sln.targets
12-
appveyor.yml = appveyor.yml
1312
build.cake = build.cake
1413
Directory.Build.props = Directory.Build.props
1514
LICENSE = LICENSE

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ This library is packaged as a nuget package available [here](https://www.nuget.o
1616
Install-Package NLog.Targets.GraylogHttp
1717
```
1818

19-
## NetStandard, .Net Core 2.1-3.0, .Net Framework 4.5
19+
## NetStandard, .Net Core 2.1-5.0, .Net Framework 4.5
2020

21-
This library runs under netstandard 1.3 and fully supports both .Net Core 2.1-3.0 and .Net Framework 4.5
21+
This library runs under netstandard 1.3 and fully supports .Net Core 2.1-3.1, .Net 5.0, and .Net Framework 4.5+
2222

2323
## Usage
2424

build.cake

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#addin "nuget:?package=Cake.Json&version=4.0.0"
2-
#addin "nuget:?package=Newtonsoft.Json&version=11.0.2"
3-
41
// ARGUMENTS
52
var target = Argument("target", "Default");
63
var configuration = Argument("configuration", "Release");
7-
var platform = Argument("platform", "Any CPU");
84
var skipTests = Argument("SkipTests", false);
95

6+
var fullSemVer = Argument("fullSemVer", "0.0.1");
7+
var assemblySemVer = Argument("assemblySemVer", "0.0.1");
8+
var informationalVersion = Argument("informationalVersion", "0.0.1");
9+
1010
// Variables
1111
var artifactsDirectory = Directory("./artifacts");
1212
var solutionFile = "./NLog.Targets.GraylogHttp.sln";
@@ -16,11 +16,11 @@ var msBuildSettings = new DotNetCoreMSBuildSettings
1616
MaxCpuCount = 1
1717
};
1818

19-
GitVersion versionInfo = null;
20-
21-
//////////////////////////////////////////////////////////////////////
22-
// PREPARATION
23-
//////////////////////////////////////////////////////////////////////
19+
msBuildSettings.Properties.Add("PackageVersion", new List<string> { fullSemVer });
20+
msBuildSettings.Properties.Add("Version", new List<string> { assemblySemVer });
21+
msBuildSettings.Properties.Add("FileVersion", new List<string> { assemblySemVer });
22+
msBuildSettings.Properties.Add("AssemblyVersion", new List<string> { assemblySemVer });
23+
msBuildSettings.Properties.Add("AssemblyInformationalVersion", new List<string> { informationalVersion });
2424

2525
// Define directories.
2626
var buildDir = Directory("./build/bin") + Directory(configuration);
@@ -38,39 +38,8 @@ Task("Restore")
3838
DotNetCoreRestore(solutionFile);
3939
});
4040

41-
Task("Version")
42-
.Does(() => {
43-
// dotnet tool install --global GitVersion.Tool --version 5.1.2
44-
DotNetCoreTool("tool",
45-
new DotNetCoreToolSettings {
46-
ArgumentCustomization = args => args.Append("restore")
47-
});
48-
49-
// dotnet gitversion /output json
50-
IEnumerable<string> redirectedStandardOutput;
51-
StartProcess(
52-
"dotnet",
53-
new ProcessSettings {
54-
Arguments = "dotnet-gitversion /output json",
55-
RedirectStandardOutput = true
56-
},
57-
out redirectedStandardOutput
58-
);
59-
60-
versionInfo = DeserializeJson<GitVersion>(string.Join(Environment.NewLine, redirectedStandardOutput));
61-
62-
Information($"::set-env name=GIT_VERSION::{versionInfo.FullSemVer}");
63-
64-
msBuildSettings.Properties.Add("PackageVersion", new List<string> { versionInfo.FullSemVer });
65-
msBuildSettings.Properties.Add("Version", new List<string> { versionInfo.AssemblySemVer });
66-
msBuildSettings.Properties.Add("FileVersion", new List<string> { versionInfo.AssemblySemVer });
67-
msBuildSettings.Properties.Add("AssemblyVersion", new List<string> { versionInfo.AssemblySemVer });
68-
msBuildSettings.Properties.Add("AssemblyInformationalVersion", new List<string> { versionInfo.InformationalVersion });
69-
});
70-
7141
Task("Build")
7242
.IsDependentOn("Restore")
73-
.IsDependentOn("Version")
7443
.Does(() =>
7544
{
7645
var path = MakeAbsolute(new DirectoryPath(solutionFile));

dotnet-tools.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
"isRoot": true,
44
"tools": {
55
"gitversion.tool": {
6-
"version": "5.1.2",
6+
"version": "5.5.1",
77
"commands": [
88
"dotnet-gitversion"
99
]
10+
},
11+
"cake.tool": {
12+
"version": "1.0.0-rc0001",
13+
"commands": [
14+
"dotnet-cake"
15+
]
1016
}
1117
}
1218
}

examples/netcore/NLogGraylogHttp.Example.NetCore/NLogGraylogHttp.Example.NetCore.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
1414
<PackageReference Include="NLog.Extensions.Logging" Version="1.4.0" />
1515
</ItemGroup>
1616

src/NLog.Targets.GraylogHttp.Tests/NLog.Targets.GraylogHttp.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
1919
<PackageReference Include="xunit" Version="2.4.1" />
2020
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
2121
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />

src/NLog.Targets.GraylogHttp/NLog.Targets.GraylogHttp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Polly" Version="6.1.2" />
18+
<PackageReference Include="Polly" Version="7.2.1" />
1919
</ItemGroup>
2020

2121
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">

0 commit comments

Comments
 (0)