Skip to content

Commit f2aa59e

Browse files
authored
add release fix (#94)
* chore(project): update company name to myCSharp.de * feat(coverage): add global coverage settings for tests * chore(ci): streamline release workflow by removing unnecessary steps * fix(assembly): consolidate public key into a single line * fix(project): add PublicKey to UnitTests visibility
1 parent eb5fa7c commit f2aa59e

4 files changed

Lines changed: 27 additions & 19 deletions

File tree

.github/workflows/release-publish.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
17+
- name: Download release assets
18+
env:
19+
GH_TOKEN: ${{ github.token }}
20+
run: |
21+
gh release download "${{ github.event.release.tag_name }}" \
22+
--pattern "*.nupkg" \
23+
--dir ./artifacts \
24+
--repo "${{ github.repository }}"
2125
2226
- name: Setup .NET
2327
uses: actions/setup-dotnet@v4
@@ -27,18 +31,6 @@ jobs:
2731
9.0.x
2832
10.0.x
2933
30-
- name: Restore dependencies
31-
run: dotnet restore
32-
33-
- name: Build
34-
run: dotnet build --configuration Release --no-restore
35-
36-
- name: Test
37-
run: dotnet test --configuration Release --no-build --verbosity normal
38-
39-
- name: Pack NuGet packages
40-
run: dotnet pack --configuration Release --no-build --output ./artifacts
41-
4234
- name: Verify packages
4335
run: |
4436
echo "Packages to be published:"

Directory.Build.props

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<PropertyGroup Label="Project">
33
<Product>MyCSharp.HttpUserAgentParser</Product>
44
<Authors>MyCSharp, BenjaminAbt, gfoidl</Authors>
5-
<Company>MyCSharp.de</Company>
5+
<Company>myCSharp.de</Company>
6+
<Copyright>myCSharp.de</Copyright>
67
</PropertyGroup>
78

89
<PropertyGroup Label="Vars">
@@ -73,6 +74,21 @@
7374
<NuGetAuditLevel>low</NuGetAuditLevel>
7475
</PropertyGroup>
7576

77+
<!-- Global coverage settings applied to all test projects -->
78+
<PropertyGroup Condition="'$(IsTestProject)' == 'true'" Label="Coverage">
79+
<CollectCoverage>true</CollectCoverage>
80+
<CoverletOutputFormat>lcov,opencover,cobertura</CoverletOutputFormat>
81+
<CoverletOutput>$(MSBuildThisFileDirectory)TestResults/coverage/$(MSBuildProjectName).</CoverletOutput>
82+
<ExcludeByAttribute>GeneratedCodeAttribute,CompilerGeneratedAttribute,ExcludeFromCodeCoverageAttribute</ExcludeByAttribute>
83+
<ExcludeByFile>**/*Program.cs;**/*Startup.cs;**/*GlobalUsings.cs</ExcludeByFile>
84+
<UseSourceLink>true</UseSourceLink>
85+
<!-- Enforce high line coverage; branch coverage is informative only -->
86+
<!-- Note: Set to 96 to account for performance-optimized helper methods and framework-specific code paths -->
87+
<Threshold>96</Threshold>
88+
<ThresholdType>line</ThresholdType>
89+
<ThresholdStat>total</ThresholdStat>
90+
</PropertyGroup>
91+
7692
<ItemGroup Label="Default Test Dependencies" Condition="'$(IsTestProject)' == 'true'">
7793
<PackageReference Include="coverlet.msbuild" />
7894
<PackageReference Include="Microsoft.NET.Test.Sdk" />

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ by [@BenjaminAbt](https://github.com/BenjaminAbt) and [@gfoidl](https://github.c
415415

416416
MIT License
417417

418-
Copyright (c) 2021-2025 MyCSharp
418+
Copyright (c) 2021-2026 myCSharp.de
419419

420420
Permission is hereby granted, free of charge, to any person obtaining a copy
421421
of this software and associated documentation files (the "Software"), to deal

src/HttpUserAgentParser/HttpUserAgentParser.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<InternalsVisibleTo Include="MyCSharp.HttpUserAgentParser.UnitTests" />
24+
<InternalsVisibleTo Include="MyCSharp.HttpUserAgentParser.UnitTests" PublicKey="$(PublicKey)" />
2525
<InternalsVisibleTo Include="MyCSharp.HttpUserAgentParser.AspNetCore" PublicKey="$(PublicKey)" />
2626
<InternalsVisibleTo Include="MyCSharp.HttpUserAgentParser.MemoryCache" PublicKey="$(PublicKey)" />
2727
</ItemGroup>

0 commit comments

Comments
 (0)