Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add updates to devops, nuget, packages, readmes and sdk #41

Merged
merged 2 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ on:
env:
BuildConfig: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_VERSION: '6.0.100' # https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Cancel previous builds in PR
uses: styfle/[email protected].0
uses: styfle/[email protected].1
with:
access_token: ${{ github.token }}

Expand All @@ -28,9 +27,9 @@ jobs:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: 'Install .NET SDK'
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
global-json-file: ./global.json

- name: Versioning
uses: dotnet/nbgv@master
Expand All @@ -54,9 +53,8 @@ jobs:
/p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }}

- name: Push to NuGet
## push only stable packages
if: github.ref == 'refs/heads/main'
run: dotnet nuget push **/*.nupkg
--api-key ${{ secrets.NUGET_DEPLOY_KEY }}
--source https://api.nuget.org/v3/index.json
--no-symbols 1
--no-symbols
--skip-duplicate
30 changes: 21 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<Project>

<PropertyGroup>
<MinClientVersion>2.12</MinClientVersion>
<Authors>MyCSharp.de, Benjamin Abt, Günther Foidl and Contributors</Authors>
<PackageProjectUrl>https://github.com/mycsharp/HttpUserAgentParser</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Product>MyCSharp.HttpUserAgentParser</Product>
<DefaultLanguage>en-US</DefaultLanguage>
<Description>HTTP User Agent Parser for .NET</Description>
<NoPackageAnalysis>true</NoPackageAnalysis>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Label="Env">

<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<IsBenchmarkProject>$(MsBuildProjectName.Contains('Benchmark'))</IsBenchmarkProject>
</PropertyGroup>

<PropertyGroup Label="Package">
<PackageProjectUrl>https://github.com/mycsharp/HttpUserAgentParser</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Description>HTTP User Agent Parser for .NET</Description>
<MinClientVersion>2.12</MinClientVersion>
<IsPackable>false</IsPackable>
<PackageTags>UserAgent, User Agent, Parse, Browser, Client, Detector, Detection, Console, ASP, Desktop, Mobile</PackageTags>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Label="C#">
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -35,5 +47,5 @@
<Error Code="420" Text="Blocked package dependency detected: %(PackageDependencies.Identity)"
Condition="'%(PackageDependencies.Identity)' == 'Devlooped.SponsorLink'" />
</Target>

</Project>
41 changes: 41 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup Label=".NET Dependencies">
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageVersion Include="NaughtyStrings" Version="2.4.1" />
</ItemGroup>
<ItemGroup Label="ASP.NET Core Dependencies">
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
</ItemGroup>
<ItemGroup Label="Libraries for comparison">
<PackageVersion Include="UAParser" Version="3.1.47" />
<PackageVersion Include="DeviceDetector.NET" Version="4.3.0" />
<PackageVersion Include="Ng.UserAgentService" Version="1.1.0" />
</ItemGroup>
<ItemGroup Label="Tests / Performance">
<PackageVersion Include="BenchmarkDotNet" Version="0.13.11" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.11" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02" />
<PackageVersion Include="xunit" Version="2.6.3" />
<PackageVersion Include="xunit.runner.console" Version="2.6.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 MyCSharp
Copyright (c) 2021-2023 MyCSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion MyCSharp.HttpUserAgentParser.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{5738CE0D-5E6E-47
.gitignore = .gitignore
.github\workflows\ci.yml = .github\workflows\ci.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
LICENSE = LICENSE
NuGet.config = NuGet.config
README.md = README.md
Expand All @@ -35,7 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{FAAD18A0-E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCSharp.HttpUserAgentParser.Benchmarks", "perf\MyCSharp.HttpUserAgentParser.Benchmarks\MyCSharp.HttpUserAgentParser.Benchmarks.csproj", "{A0D213E9-6408-46D1-AFAF-5096C2F6E027}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCSharp.HttpUserAgentParser.TestHelpers", "tests\MyCSharp.HttpUserAgentParser.TestHelpers\MyCSharp.HttpUserAgentParser.TestHelpers.csproj", "{165EE915-1A4F-4875-90CE-1A2AE1540AE7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCSharp.HttpUserAgentParser.TestHelpers", "tests\MyCSharp.HttpUserAgentParser.TestHelpers\MyCSharp.HttpUserAgentParser.TestHelpers.csproj", "{165EE915-1A4F-4875-90CE-1A2AE1540AE7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ by [@BenjaminAbt](https://github.com/BenjaminAbt) and [@gfoidl](https://github.c

MIT License

Copyright (c) 2021 MyCSharp
Copyright (c) 2021-2023 MyCSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -160,3 +160,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "8.0.100"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Nullable>disable</Nullable>
</PropertyGroup>

Expand All @@ -15,18 +15,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.2" Condition="'$(OS)' == 'Windows_NT'" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Condition="'$(OS)' == 'Windows_NT'" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\MyCSharp.HttpUserAgentParser\MyCSharp.HttpUserAgentParser.csproj" />
<ItemGroup Label="Libraries for comparison">
<PackageReference Include="UAParser" />
<PackageReference Include="DeviceDetector.NET" />
<PackageReference Include="Ng.UserAgentService" />
</ItemGroup>

<ItemGroup Label="Libraries for comparison">
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="DeviceDetector.NET" Version="4.3.0" />
<PackageReference Include="Ng.UserAgentService" Version="1.1.0" />
<ItemGroup>
<ProjectReference Include="..\..\src\MyCSharp.HttpUserAgentParser\MyCSharp.HttpUserAgentParser.csproj" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions src/MyCSharp.HttpUserAgentParser.AspNetCore/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2023 MyCSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
<PropertyGroup>
<Product>HTTP User Agent Parser Extensions for ASP.NET Core</Product>
<Description>HTTP User Agent Parser Extensions for ASP.NET Core</Description>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Package">
<IsPackable>true</IsPackable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="" />
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/MyCSharp.HttpUserAgentParser.AspNetCore/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MyCSharp.HttpUserAgentParser

Parsing HTTP User Agents with .NET

https://github.com/mycsharp/HttpUserAgentParser
21 changes: 21 additions & 0 deletions src/MyCSharp.HttpUserAgentParser.MemoryCache/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2023 MyCSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
<PropertyGroup>
<Product>HTTP User Agent Parser Extensions for IMemoryCache</Product>
<Description>HTTP User Agent Parser Extensions for IMemoryCache</Description>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is explicit net8.0 needed?
We don't use any features from .NET 8, so this is just a build target w/o any real use.

Same question on the other places too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I know the reason now 😉.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gfoidl What is the reason? Thought it does not make a difference if a library ist .net6 or .net8 as long as it is consumed in a .net8 application.

Copy link
Member Author

@BenjaminAbt BenjaminAbt Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefannikolei the ILCode can now change as the .NET compiler now incorporates certain features into the ILCode. In our case here there should be no changes.


Specifying the multiple monikers is actually the recommended way (today). Analyzers and tools - even NuGet - only show your library as a "compatible target framework"; otherwise the fallback to "computed".
https://medium.com/medialesson/compile-net-libs-for-multiple-target-frameworks-499b21505789

Unfortunately, there are also third-party tools that issue a warning if - as in our case - the package is still for .NET 6 (although it still has 10 months of official support) -> breaking change in the version bump.

Functionally nothing has changed in this update. So if you still need .NET 6, you can simply stay on 2.x.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for clarification.

</PropertyGroup>

<PropertyGroup Label="Package">
<IsPackable>true</IsPackable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="..\NetStandard2.0-Shim.cs" />
<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="" />
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/MyCSharp.HttpUserAgentParser.MemoryCache/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MyCSharp.HttpUserAgentParser

Parsing HTTP User Agents with .NET

https://github.com/mycsharp/HttpUserAgentParser
21 changes: 21 additions & 0 deletions src/MyCSharp.HttpUserAgentParser/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2023 MyCSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
<PropertyGroup>
<Product>HTTP User Agent Parser</Product>
<Description>Parses user agents for Browser, Platform and Bots.</Description>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Package">
<IsPackable>true</IsPackable>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="..\NetStandard2.0-Shim.cs" />
<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="" />
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/MyCSharp.HttpUserAgentParser/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MyCSharp.HttpUserAgentParser

Parsing HTTP User Agents with .NET

https://github.com/mycsharp/HttpUserAgentParser
Loading
Loading