Skip to content

Commit

Permalink
Added support for .NET 7
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddesmet committed Apr 20, 2023
1 parent b0210b7 commit 6ed08f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,15 @@ jobs:
- name: 'Git Fetch Tags'
run: git fetch --tags
- name: 'Install .NET SDK'
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
uses: actions/setup-dotnet@v3
- name: '.NET Restore'
run: dotnet tool restore
- name: 'Build Project'
run: dotnet cake --target=Build
- name: 'Run Unit Tests'
run: dotnet cake --target=Test
- name: 'Run Unit Tests'
run: dotnet test -f net6.0 --no-restore --logger trx -r ${{env.BUILD_ARTIFACT_PATH}} --settings "CodeCoverage.runsettings"
run: dotnet test -f net7.0 --no-restore --logger trx -r ${{env.BUILD_ARTIFACT_PATH}} --settings "CodeCoverage.runsettings"
if: ${{ false }} # always skip since coverage is somehow always empty in GitHub Actions
- name: 'Run Test Report'
uses: zyborg/dotnet-tests-report@v1
Expand Down Expand Up @@ -124,7 +121,7 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Run Benchmarks'
run: cd benchmarks/Paseto.Benchmark && dotnet run -f net6.0 -c Release --exporters json --filter '*'
run: cd benchmarks/Paseto.Benchmark && dotnet run -f net7.0 -c Release --exporters json --filter '*'
- name: 'Store Benchmark Result'
uses: rhysd/github-action-benchmark@v1
with:
Expand Down
12 changes: 6 additions & 6 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.101",
"rollForward": "latestFeature"
}
}
{
"sdk": {
"version": "7.0.202",
"rollForward": "latestFeature"
}
}
2 changes: 2 additions & 0 deletions src/Paseto/Paserk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public static PasetoKey Decode(string serializedKey)
internal static IPasetoProtocolVersion CreateProtocolVersion(ProtocolVersion version)
{
#pragma warning disable IDE0022 // Use expression body for methods
#pragma warning disable CS0618 // obsolete
return version switch
{
ProtocolVersion.V1 => new Version1(),
Expand All @@ -217,5 +218,6 @@ internal static IPasetoProtocolVersion CreateProtocolVersion(ProtocolVersion ver
_ => throw new PaserkNotSupportedException($"The protocol version {version} is currently not supported."),
};
#pragma warning restore IDE0022 // Use expression body for methods
#pragma warning restore CS0618 // obsolete
}
}
15 changes: 5 additions & 10 deletions src/Paseto/Paseto.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand All @@ -10,7 +10,7 @@
<Authors>David De Smet</Authors>
<Company />
<Description>A Paseto (Platform-Agnostic Security Tokens) implementation for .NET</Description>
<Copyright>Copyright © 2018-2022 David De Smet</Copyright>
<Copyright>Copyright © 2018-2023 David De Smet</Copyright>
<PackageId>Paseto.Core</PackageId>
<PackageTags>paseto paserk tokens cryptography dotnet dotnet-core netstandard</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down Expand Up @@ -48,8 +48,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NaCl.Core" Version="2.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NaCl.Core" Version="2.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>

Expand All @@ -60,12 +60,7 @@

<Target Name="Versioning" BeforeTargets="MinVer">
<PropertyGroup Label="Build">
<MinVerDefaultPreReleasePhase>preview</MinVerDefaultPreReleasePhase>
<!-- Tag your repository with the semantic version e.g. '1.0.0' to version all NuGet packages. If you have
multiple NuGet packages in your solution and want to version them separately, then uncomment this line
and tag your repository with the name of the package followed by the semantic version e.g.
'PackageName-1.0.0'. -->
<!--<MinVerTagPrefix>$(PackageId)-</MinVerTagPrefix>-->
<AssemblyVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).0</AssemblyVersion>
<MinVerVerbosity>normal</MinVerVerbosity>
</PropertyGroup>
</Target>
Expand Down
9 changes: 4 additions & 5 deletions tests/Paseto.Tests/Paseto.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">net6.0;net7.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<Version>0.7.2</Version>
<Authors>David De Smet</Authors>
<Copyright>Copyright © 2019 David De Smet</Copyright>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
Expand Down Expand Up @@ -178,7 +177,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="xunit" Version="2.4.2" />
Expand Down

0 comments on commit 6ed08f8

Please sign in to comment.