Skip to content

Commit 1d7451c

Browse files
committed
Add NuGet governance improvements
1 parent dde53af commit 1d7451c

13 files changed

Lines changed: 179 additions & 265 deletions

.editorConfig

Lines changed: 0 additions & 217 deletions
This file was deleted.

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
root = true
2+
3+
# Rules in this file were initially inferred by Visual Studio IntelliCode from the F:\Projects\PanoramicData.ReportMagic\2.x codebase based on best match to current usage at 05/12/2018
4+
[*]
5+
charset = utf-8
6+
end_of_line = crlf
7+
indent_style = tab
8+
indent_size = 4
9+
tab_width = 4
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.cs]
14+
csharp_new_line_before_open_brace = all
15+
csharp_indent_labels = one_less_than_current
16+
csharp_using_directive_placement = outside_namespace:silent
17+
csharp_prefer_braces = true:suggestion
18+
csharp_style_namespace_declarations = file_scoped:silent
19+
csharp_style_var_for_built_in_types = true:suggestion
20+
csharp_style_var_when_type_is_apparent = true:suggestion
21+
csharp_style_var_elsewhere = true:suggestion
22+
dotnet_sort_system_directives_first = false
23+
dotnet_style_qualification_for_field = false:suggestion
24+
dotnet_style_qualification_for_method = false:suggestion
25+
dotnet_style_qualification_for_property = false:suggestion
26+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
27+
dotnet_style_predefined_type_for_member_access = true:suggestion
28+
29+
[*.{csproj,props,targets,json,md,yml,yaml}]
30+
indent_style = space
31+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 10.0.201
23+
24+
- name: Restore library
25+
run: dotnet restore PanoramicData.SyslogServer/PanoramicData.SyslogServer.csproj
26+
27+
- name: Restore example app
28+
run: dotnet restore ExampleApp/ExampleApp.csproj
29+
30+
- name: Build library
31+
run: dotnet build PanoramicData.SyslogServer/PanoramicData.SyslogServer.csproj --configuration Release --no-restore
32+
33+
- name: Build example app
34+
run: dotnet build ExampleApp/ExampleApp.csproj --configuration Release --no-restore
35+
36+
- name: Pack library
37+
run: dotnet pack PanoramicData.SyslogServer/PanoramicData.SyslogServer.csproj --configuration Release --no-build --output ./artifacts
38+
39+
- name: Upload packages
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: nuget-packages
43+
path: artifacts/*.nupkg
44+
45+
publish:
46+
if: startsWith(github.ref, 'refs/tags/v')
47+
needs: build
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Setup .NET
55+
uses: actions/setup-dotnet@v4
56+
with:
57+
dotnet-version: 10.0.201
58+
59+
- name: Restore library
60+
run: dotnet restore PanoramicData.SyslogServer/PanoramicData.SyslogServer.csproj
61+
62+
- name: Pack library
63+
run: dotnet pack PanoramicData.SyslogServer/PanoramicData.SyslogServer.csproj --configuration Release --output ./artifacts
64+
65+
- name: Publish to NuGet
66+
run: dotnet nuget push "./artifacts/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Company>Panoramic Data Limited</Company>
4+
<Authors>Panoramic Data Limited</Authors>
5+
<Copyright>© $([System.DateTime]::Now.Year) Panoramic Data Limited</Copyright>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<Nullable>enable</Nullable>
8+
<NuGetAuditMode>All</NuGetAuditMode>
9+
</PropertyGroup>
10+
</Project>

Directory.Packages.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="Elastic.Serilog.Sinks" Version="9.0.0" />
7+
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.5" />
8+
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.5" />
9+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.5" />
10+
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.5" />
11+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.5" />
12+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.5" />
13+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
14+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.5" />
15+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.9.50" />
16+
<PackageVersion Include="Serilog.Extensions.Hosting" Version="10.0.0" />
17+
<PackageVersion Include="Serilog.Settings.Configuration" Version="10.0.0" />
18+
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
19+
</ItemGroup>
20+
</Project>

0 commit comments

Comments
 (0)