Skip to content

Commit

Permalink
Major: support for .NET 9 (#26)
Browse files Browse the repository at this point in the history
* Updated target to net9.0

* Merged net8.0 and net9.0 targets

* Updated workflows
  • Loading branch information
XFox111 authored Nov 28, 2024
1 parent ee0ae96 commit 989ed46
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: [ "main", "next" ]
paths-ignore:
- '**.md'
- 'LICENSE'
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Build workflow"

on:
push:
branches: [ "main" ]
branches: [ "main", "next" ]
paths-ignore:
- "**.md"
- "LICENSE"
Expand All @@ -12,7 +12,7 @@ on:
- ".devcontainer/*"
- "!.github/workflows/pr-workflow.yml"
pull_request:
branches: [ "main" ]
branches: [ "main", "next" ]
paths-ignore:
- "**.md"
- "LICENSE"
Expand All @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions SimpleOTP.Tests/SimpleOTP.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<PackageId>EugeneFox.SimpleOTP.DependencyInjection</PackageId>
<Version>8.0.0.0</Version>
<Version>9.0.0.0</Version>
<Authors>Eugene Fox</Authors>
<Copyright>Copyright © Eugene Fox 2024</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>
Expand Down Expand Up @@ -37,7 +37,7 @@
service in your application.
</Description>
<PackageReleaseNotes>
Initial release. See README.md for details.
New major version for .NET 9
</PackageReleaseNotes>
</PropertyGroup>

Expand All @@ -57,9 +57,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"
Version="8.0.*" />
Version="9.0.*" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions libraries/SimpleOTP/Otp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace SimpleOTP;

// TODO: Add tests

/// <summary>
/// Represents an abstract class for generating and validating One-Time Passwords (OTP).
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions libraries/SimpleOTP/SimpleOTP.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -14,7 +14,7 @@

<PropertyGroup>
<PackageId>EugeneFox.SimpleOTP</PackageId>
<Version>8.0.0.0</Version>
<Version>9.0.0.0</Version>
<Authors>Eugene Fox</Authors>
<Copyright>Copyright © Eugene Fox 2024</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>
Expand All @@ -35,7 +35,7 @@
Feature-rich, fast, and customizable library for implementation TOTP/HOTP authenticators and validators.
</Description>
<PackageReleaseNotes>
(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
</PackageReleaseNotes>
</PropertyGroup>

Expand Down

0 comments on commit 989ed46

Please sign in to comment.