From 989ed46f3b660001f28c150ad50bac0cd2c3b9c2 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Thu, 28 Nov 2024 16:00:26 +0300 Subject: [PATCH] Major: support for .NET 9 (#26) * Updated target to net9.0 * Merged net8.0 and net9.0 targets * Updated workflows --- .devcontainer/devcontainer.json | 2 +- .github/workflows/codeql-analysis.yml | 16 ++++++++++++---- .github/workflows/pr-workflow.yml | 8 ++++---- .github/workflows/release-workflow.yml | 2 +- SimpleOTP.Tests/SimpleOTP.Tests.csproj | 4 ++-- .../SimpleOTP.DependencyInjection.csproj | 10 +++++----- libraries/SimpleOTP/Otp.cs | 2 -- libraries/SimpleOTP/SimpleOTP.csproj | 6 +++--- 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a427de6..ea10881 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "SimpleOTP", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0", + "image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b203d04..8c730ba 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,7 +8,7 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: [ "main", "next" ] paths-ignore: - '**.md' - 'LICENSE' @@ -19,7 +19,7 @@ on: - '.assets/*' pull_request: # The branches below must be a subset of the branches above - branches: [ "main" ] + branches: [ "main", "next" ] paths-ignore: - '**.md' - 'LICENSE' @@ -66,8 +66,16 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - name: Build project + run: dotnet build # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun diff --git a/.github/workflows/pr-workflow.yml b/.github/workflows/pr-workflow.yml index f4b8366..4f1945e 100644 --- a/.github/workflows/pr-workflow.yml +++ b/.github/workflows/pr-workflow.yml @@ -2,7 +2,7 @@ name: "Build workflow" on: push: - branches: [ "main" ] + branches: [ "main", "next" ] paths-ignore: - "**.md" - "LICENSE" @@ -12,7 +12,7 @@ on: - ".devcontainer/*" - "!.github/workflows/pr-workflow.yml" pull_request: - branches: [ "main" ] + branches: [ "main", "next" ] paths-ignore: - "**.md" - "LICENSE" @@ -33,7 +33,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - run: dotnet restore - run: dotnet build --no-restore @@ -46,7 +46,7 @@ jobs: with: name: SimpleOTP path: libraries/SimpleOTP/bin/Debug/EugeneFox.SimpleOTP*.*nupkg - + - name: Drop SimpleOTP.DependencyInjection uses: actions/upload-artifact@main with: diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 1b2db76..1751ff4 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - run: dotnet restore - run: dotnet pack diff --git a/SimpleOTP.Tests/SimpleOTP.Tests.csproj b/SimpleOTP.Tests/SimpleOTP.Tests.csproj index 55c2120..c69c6b3 100644 --- a/SimpleOTP.Tests/SimpleOTP.Tests.csproj +++ b/SimpleOTP.Tests/SimpleOTP.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,7 +10,7 @@ - + diff --git a/libraries/SimpleOTP.DependencyInjection/SimpleOTP.DependencyInjection.csproj b/libraries/SimpleOTP.DependencyInjection/SimpleOTP.DependencyInjection.csproj index b5bb127..0971799 100644 --- a/libraries/SimpleOTP.DependencyInjection/SimpleOTP.DependencyInjection.csproj +++ b/libraries/SimpleOTP.DependencyInjection/SimpleOTP.DependencyInjection.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;net9.0 enable enable true @@ -9,7 +9,7 @@ EugeneFox.SimpleOTP.DependencyInjection - 8.0.0.0 + 9.0.0.0 Eugene Fox Copyright © Eugene Fox 2024 en-US @@ -37,7 +37,7 @@ service in your application. - Initial release. See README.md for details. + New major version for .NET 9 @@ -57,9 +57,9 @@ - + + Version="9.0.*" /> diff --git a/libraries/SimpleOTP/Otp.cs b/libraries/SimpleOTP/Otp.cs index d6c200c..56ba672 100644 --- a/libraries/SimpleOTP/Otp.cs +++ b/libraries/SimpleOTP/Otp.cs @@ -2,8 +2,6 @@ namespace SimpleOTP; -// TODO: Add tests - /// /// Represents an abstract class for generating and validating One-Time Passwords (OTP). /// diff --git a/libraries/SimpleOTP/SimpleOTP.csproj b/libraries/SimpleOTP/SimpleOTP.csproj index 0712ec5..7fc63fe 100644 --- a/libraries/SimpleOTP/SimpleOTP.csproj +++ b/libraries/SimpleOTP/SimpleOTP.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;net9.0 enable enable true @@ -14,7 +14,7 @@ EugeneFox.SimpleOTP - 8.0.0.0 + 9.0.0.0 Eugene Fox Copyright © Eugene Fox 2024 en-US @@ -35,7 +35,7 @@ Feature-rich, fast, and customizable library for implementation TOTP/HOTP authenticators and validators. - (BREAKING CHANGE) Complete overhaul of the library. See https://github.com/XFox111/SimpleOTP/releases/tag/2.0.0 for more details. + New major version for .NET 9