From 821bb180c572969a3dcbab173765e011ac1b94cc Mon Sep 17 00:00:00 2001
From: Benjamin Abt <mail@benjamin-abt.com>
Date: Wed, 13 Nov 2024 14:05:47 +0100
Subject: [PATCH] add updates

---
 .github/workflows/{ci.yml => build.yml}       |  43 ++++++++++++------
 ...tchanet.sln => BenjaminAbt.HCaptchaNET.sln |   3 +-
 BenjaminAbt.HCaptchaNET.snk                   | Bin 0 -> 596 bytes
 Directory.Build.props                         |  34 ++++++++++++--
 Directory.Packages.props                      |  12 +++++
 global.json                                   |   2 +-
 public.snk                                    | Bin 0 -> 160 bytes
 .../sample.aspnetcore.csproj                  |   1 -
 .../HCaptcha.AspNetCore.csproj                |   9 +---
 src/HCaptcha/HCaptcha.csproj                  |  13 ++----
 version.json                                  |   2 +-
 11 files changed, 80 insertions(+), 39 deletions(-)
 rename .github/workflows/{ci.yml => build.yml} (52%)
 rename hcaptchanet.sln => BenjaminAbt.HCaptchaNET.sln (96%)
 create mode 100644 BenjaminAbt.HCaptchaNET.snk
 create mode 100644 Directory.Packages.props
 create mode 100644 public.snk

diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml
similarity index 52%
rename from .github/workflows/ci.yml
rename to .github/workflows/build.yml
index c2fd5ba..eeeaec5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/build.yml
@@ -1,18 +1,17 @@
-name: NETCore
+name: NET
 
 on:
     push:
       branches:
         - main
     pull_request:
-      types: [labeled]
       branches:
         - main
 
+
 env:
   BuildConfig: Release
   DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
-  DOTNET_VERSION: '6.0.101'  # https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json
 
 jobs:
     build:
@@ -20,42 +19,60 @@ jobs:
       steps:
 
       - name: Cancel previous builds in PR
-        uses: styfle/cancel-workflow-action@0.9.1
+        uses: styfle/cancel-workflow-action@0.12.1
         with:
           access_token: ${{ github.token }}
 
-      - name: Checkout
-        uses: actions/checkout@v2
+      - name: Checkout code
+        uses: actions/checkout@v4
         with:
           fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
       
-      - name: 'Install .NET SDK'
-        uses: actions/setup-dotnet@v1
+      - name: Setup .NET SDK
+        uses: actions/setup-dotnet@v4
         with:
-          dotnet-version: ${{ env.DOTNET_VERSION }}
+          global-json-file: ./global.json
+
+      - name: Restore dependencies
+        run: dotnet restore
 
-      - name: Versioning
+      - name: Setup Git Versioning
         uses: dotnet/nbgv@master
         id: nbgv
 
-      - name: Version Info
+      - name: Show Version Info
         run: |
           echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
+
       - name: Build with dotnet
         run: dotnet build
-              --configuration ${{ env.BuildConfig }}
+              --no-restore --configuration ${{ env.BuildConfig }}
               /p:Version=${{ steps.nbgv.outputs.AssemblyVersion }}
 
       - name: Test with dotnet
         run: dotnet test
+              --no-build --configuration ${{ env.BuildConfig }}
+              --logger "trx;LogFileName=test-results.trx" --results-directory ./artifacts/testResults
+        continue-on-error: true
+
+      - name: Test Report
+        uses: dorny/test-reporter@v1
+        if: always()
+        with:
+          name: DotNET Tests
+          path: "./artifacts/testResults/test-results.trx"
+          reporter: dotnet-trx
+          fail-on-error: true
 
       - name: Pack NuGet
         run: dotnet pack
               --configuration ${{ env.BuildConfig }}
+              /p:ContinuousIntegrationBuild=true
               /p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }}
 
       - name: Push to NuGet
         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
diff --git a/hcaptchanet.sln b/BenjaminAbt.HCaptchaNET.sln
similarity index 96%
rename from hcaptchanet.sln
rename to BenjaminAbt.HCaptchaNET.sln
index fe11afe..351ee25 100644
--- a/hcaptchanet.sln
+++ b/BenjaminAbt.HCaptchaNET.sln
@@ -16,8 +16,9 @@ EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{246E4F1E-C4B3-4180-906C-605E72C69097}"
 	ProjectSection(SolutionItems) = preProject
 		.editorconfig = .editorconfig
-		.github\workflows\ci.yml = .github\workflows\ci.yml
+		.github\workflows\build.yml = .github\workflows\build.yml
 		Directory.Build.props = Directory.Build.props
+		Directory.Packages.props = Directory.Packages.props
 		global.json = global.json
 		README.md = README.md
 		version.json = version.json
diff --git a/BenjaminAbt.HCaptchaNET.snk b/BenjaminAbt.HCaptchaNET.snk
new file mode 100644
index 0000000000000000000000000000000000000000..f1183201df4b3166e33b5a73ea6ad9397edea700
GIT binary patch
literal 596
zcmV-a0;~N80ssI2Bme+XQ$aES1ONa500980x^B%{E=s8hQzEIl>)=^t+fN0*Bi|HP
z{CfyMdDpWbqp-a7yC;pFX889Fem#LY>uQ#|_g?rgGo|3=RgL#_)pc2%+WY3<M^Y`f
zBDN$*V4&5rv%kJ1#SLkM5yjD-JvU{^S(pjpfR51CviTB|m8n!{NKUK>6|ivXTb0~<
zPm|eyWYl7NN5!e;@N*rQx_wiZi27x}7I{d`hv{h9BWA+RSdUOF4s3l$!~aq%u2v4Z
z#HiX?CNa(i%ZL0c(<)bO2|H@*RYywfWQ8k{M!afy^4*WbT|w{d(GLC(66+Zkaj{@A
zL^}QvKBe&=K_tPkdHCBUa@w1EGo9c06=PBxE0nSDQa<J0YPq}X=w7gpFQg(v1QIH>
z`{tG&4q4_G|D=4ty7DYB<6YC`t8nbI^SI!8i|)O?C+9cqQx@X-nk#xeLcc&dE|6f$
z!mvP{8=I)4ewEtftv86SoNnvLZASQu&VoC&5>T)?dbZk-A*0^5f-dK3ELd=}n?Ax}
z!>3{_r^M)v1Btdbk~NW&s*#z1*_EC1jPj{H81#)a2n6)@O)poc3Yih-F>_#=63^)^
zhiQaFl-TD*q045n3UhH(sHugsu6t}1z0jw`+`ZN<Ef|!i2qEl~`W~>e0);&_$a8er
z*7cRh=9}ugE$7kcsyjkXyim)&2jlE^0z!tA762~#Aw#TiUl)ZgIaimSs_SO$xxmp|
i#Z8yokVLeG7_QO$OU2$u{X9|xa$a~sRzI}mgOMG*rY}?g

literal 0
HcmV?d00001

diff --git a/Directory.Build.props b/Directory.Build.props
index 8f37e32..bcef4ef 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,19 +6,45 @@
         <PackageProjectUrl>https://github.com/BenjaminAbt/hcaptcha</PackageProjectUrl>
         <PackageLicenseExpression>MIT</PackageLicenseExpression>
         <DefaultLanguage>en-US</DefaultLanguage>
-        <NoPackageAnalysis>true</NoPackageAnalysis>
-        <LangVersion>preview</LangVersion>
-        <Nullable>enable</Nullable>
         <EmbedUntrackedSources>true</EmbedUntrackedSources>
         <PublishRepositoryUrl>true</PublishRepositoryUrl>
         <DebugType>embedded</DebugType>
+        <IsPackable>false</IsPackable>
+        <IncludeSymbols>true</IncludeSymbols>
+        <SymbolPackageFormat>snupkg</SymbolPackageFormat>
+    </PropertyGroup>
+
+    <PropertyGroup Label="Env">
         <IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
         <IsBenchmarkProject>$(MsBuildProjectName.Contains('Benchmark'))</IsBenchmarkProject>
-        <IsPackable>false</IsPackable>
     </PropertyGroup>
 
     <PropertyGroup Condition="'$(IsTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true'">
         <GenerateDocumentationFile Condition="'$(Configuration)' == 'Release'">true</GenerateDocumentationFile>
     </PropertyGroup>
 
+    <PropertyGroup Label="Project Defaults">
+        <TargetFrameworks>net8.0</TargetFrameworks>
+    </PropertyGroup>
+    
+    <PropertyGroup Label="C#">
+        <LangVersion>preview</LangVersion>
+        <Nullable>enable</Nullable>
+        <ImplicitUsings>enable</ImplicitUsings>
+        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <SignAssembly>true</SignAssembly>
+        <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)BenjaminAbt.HCaptchaNET.snk</AssemblyOriginatorKeyFile>
+
+        <PublicKey>
+            0024000004800000940000000602000000240000525341310004000001000100a9ba6ecd5a2e4a
+            a9095322a9baebe05966db4f05bf23df1457fc7b084079d7b320a3b0bcf5bb278d9e66f8f70d7e
+            3d813aeb6a96baf75ef83033a5e0e5558df774d575599cdafbe6e047522db722b6244860a0d5b3
+            b3bfbe24c50d698411c5d19e3d3765c9599809e2808ed0d6b2f9129395a95468484eac0815b070
+            ea5b95dc
+        </PublicKey>
+    </PropertyGroup>
+
 </Project>
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..ff021a9
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,12 @@
+<Project>
+    <PropertyGroup>
+        <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
+    </PropertyGroup>
+    
+    <ItemGroup Label=".NET Dependencies">
+        <PackageVersion Include="Refit" Version="7.2.22" />
+        <PackageVersion Include="Refit.HttpClientFactory" Version="7.2.22" />
+        <PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" />
+        <PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
+    </ItemGroup>
+</Project>
diff --git a/global.json b/global.json
index 2a9ec01..76474f0 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
 {
     "sdk": {
-        "version": "6.0.101"
+        "version": "9.0.100"
     }
 }
diff --git a/public.snk b/public.snk
new file mode 100644
index 0000000000000000000000000000000000000000..c708c4c904d51f76cbc6ba37a0b06050adf4ed39
GIT binary patch
literal 160
zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa500980x^B%{E=s8hQzEIl
z>)=^t+fN0*Bi|HP{CfyMdDpWbqp-a7yC;pFX889Fem#LY>uQ#|_g?rgGo|3=RgL#_
z)pc2%+WY3<M^Y`fBDN$*V4&5rv%kJ1#SLkM5yjD-JvU{^S(pjpfR51CviTB|m8n!{
ONKUK>6|ivXTb0~^G)8Cu

literal 0
HcmV?d00001

diff --git a/sample/sample.aspnetcore/sample.aspnetcore.csproj b/sample/sample.aspnetcore/sample.aspnetcore.csproj
index 6a177a0..ba76029 100644
--- a/sample/sample.aspnetcore/sample.aspnetcore.csproj
+++ b/sample/sample.aspnetcore/sample.aspnetcore.csproj
@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
     <AssemblyName>BenjaminAbt.HCaptcha.Samples.AspNetCore</AssemblyName>
     <RootNamespace>BenjaminAbt.HCaptcha.Samples.AspNetCore</RootNamespace>
   </PropertyGroup>
diff --git a/src/HCaptcha.AspNetCore/HCaptcha.AspNetCore.csproj b/src/HCaptcha.AspNetCore/HCaptcha.AspNetCore.csproj
index 6728da3..00d3da8 100644
--- a/src/HCaptcha.AspNetCore/HCaptcha.AspNetCore.csproj
+++ b/src/HCaptcha.AspNetCore/HCaptcha.AspNetCore.csproj
@@ -2,16 +2,9 @@
 
     <PropertyGroup>
         <Product>HCaptcha for ASP.NET Core</Product>
-        <TargetFramework>net6.0</TargetFramework>
         <AssemblyName>BenjaminAbt.HCaptcha.AspNetCore</AssemblyName>
         <RootNamespace>BenjaminAbt.HCaptcha.AspNetCore</RootNamespace>
-        <GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
         <DebugType>embedded</DebugType>
-    </PropertyGroup>
-
-    <PropertyGroup>
-        <IncludeSymbols>true</IncludeSymbols>
-        <SymbolPackageFormat>snupkg</SymbolPackageFormat>
         <IsPackable>true</IsPackable>
     </PropertyGroup>
 
@@ -34,7 +27,7 @@
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="Refit.HttpClientFactory" Version="6.1.15" />
+        <PackageReference Include="Refit.HttpClientFactory" />
     </ItemGroup>
 
     <ItemGroup>
diff --git a/src/HCaptcha/HCaptcha.csproj b/src/HCaptcha/HCaptcha.csproj
index d4190ee..15986f6 100644
--- a/src/HCaptcha/HCaptcha.csproj
+++ b/src/HCaptcha/HCaptcha.csproj
@@ -4,14 +4,7 @@
         <Product>HCaptcha for .NET</Product>
         <AssemblyName>BenjaminAbt.HCaptcha</AssemblyName>
         <RootNamespace>BenjaminAbt.HCaptcha</RootNamespace>
-        <TargetFramework>net6.0</TargetFramework>
-        <GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
         <DebugType>embedded</DebugType>
-    </PropertyGroup>
-
-    <PropertyGroup>
-        <IncludeSymbols>true</IncludeSymbols>
-        <SymbolPackageFormat>snupkg</SymbolPackageFormat>
         <IsPackable>true</IsPackable>
     </PropertyGroup>
 
@@ -30,9 +23,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Refit" Version="6.1.15" />
-        <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
-        <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
+        <PackageReference Include="Refit" />
+        <PackageReference Include="Microsoft.Extensions.Options" />
+        <PackageReference Include="Microsoft.Extensions.Http" />
     </ItemGroup>
 
 </Project>
diff --git a/version.json b/version.json
index 1a05557..1dc6bc7 100644
--- a/version.json
+++ b/version.json
@@ -1,6 +1,6 @@
 {
   "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
-  "version": "0.9",
+  "version": "1.0",
   "assemblyVersion": {
     "precision": "revision" // optional. Use when you want a more precise assembly version than the default major.minor.
   },