From b68b4b37d954923015fb8093b337af8adf537a1d Mon Sep 17 00:00:00 2001 From: Tony Troeff Date: Thu, 9 Jan 2025 23:30:28 +0200 Subject: [PATCH 1/5] Added support for .NET 9 with target-framework-specific referenced package versions. --- .../TryAtSoftware.CleanTests.UnitTests.csproj | 6 +++--- .../TryAtSoftware.CleanTests.Core.csproj | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj b/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj index 4204d51..a90a0da 100644 --- a/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj +++ b/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 latest enable enable @@ -19,7 +19,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -33,7 +33,7 @@ - + diff --git a/TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj b/TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj index 1b7003a..9538d1a 100644 --- a/TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj +++ b/TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj @@ -1,7 +1,7 @@ - netstandard2.1;net6.0;net7.0;net8.0 + netstandard2.1;net6.0;net7.0;net8.0;net9.0 latest enable false @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,7 +35,7 @@ - + @@ -46,7 +46,12 @@ - + + + + + + From a5a138e8b7c452efea55f12b28b77dc902020ed5 Mon Sep 17 00:00:00 2001 From: Tony Troeff Date: Thu, 9 Jan 2025 23:32:21 +0200 Subject: [PATCH 2/5] Updated all satelite projects to use .NET 9 --- Samples/Calculator/Calculator.API/Calculator.API.csproj | 2 +- .../Calculator.CleanTests/Calculator.CleanTests.csproj | 2 +- .../Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj | 2 +- Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj | 2 +- Samples/Job Agency/JobAgency.Models/JobAgency.Models.csproj | 2 +- .../TryAtSoftware.CleanTests.Benchmark.csproj | 2 +- .../TryAtSoftware.CleanTests.Sample.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Samples/Calculator/Calculator.API/Calculator.API.csproj b/Samples/Calculator/Calculator.API/Calculator.API.csproj index 307bd1c..f898263 100644 --- a/Samples/Calculator/Calculator.API/Calculator.API.csproj +++ b/Samples/Calculator/Calculator.API/Calculator.API.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable diff --git a/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj b/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj index c989478..a7630b1 100644 --- a/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj +++ b/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable diff --git a/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj b/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj index 27b7f03..432fcaa 100644 --- a/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj +++ b/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable false diff --git a/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj b/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj index f70e5d6..efade31 100644 --- a/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj +++ b/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable diff --git a/Samples/Job Agency/JobAgency.Models/JobAgency.Models.csproj b/Samples/Job Agency/JobAgency.Models/JobAgency.Models.csproj index 27dae03..bfa5e14 100644 --- a/Samples/Job Agency/JobAgency.Models/JobAgency.Models.csproj +++ b/Samples/Job Agency/JobAgency.Models/JobAgency.Models.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable diff --git a/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj b/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj index 2eefd59..5fa4355 100644 --- a/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj +++ b/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 Exe diff --git a/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj b/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj index 593c21c..c5cc96e 100644 --- a/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj +++ b/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable From 373bd73078a02ede5006c2b5f108b878f24310a1 Mon Sep 17 00:00:00 2001 From: Tony Troeff Date: Thu, 9 Jan 2025 23:36:10 +0200 Subject: [PATCH 3/5] Updated all satelite referenced packages to latest --- .../Calculator.CleanTests.csproj | 12 ++++++------ .../JobAgency.CleanTests/JobAgency.CleanTests.csproj | 10 +++++----- .../Job Agency/JobAgency.Data/JobAgency.Data.csproj | 4 ++-- .../TryAtSoftware.CleanTests.Benchmark.csproj | 2 +- .../TryAtSoftware.CleanTests.UnitTests.csproj | 10 +++++----- .../TryAtSoftware.CleanTests.Sample.csproj | 10 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj b/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj index a7630b1..fad0f57 100644 --- a/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj +++ b/Samples/Calculator/Calculator.CleanTests/Calculator.CleanTests.csproj @@ -10,20 +10,20 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj b/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj index 432fcaa..496f75f 100644 --- a/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj +++ b/Samples/Job Agency/JobAgency.CleanTests/JobAgency.CleanTests.csproj @@ -8,19 +8,19 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj b/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj index efade31..541d2dc 100644 --- a/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj +++ b/Samples/Job Agency/JobAgency.Data/JobAgency.Data.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj b/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj index 5fa4355..84f392a 100644 --- a/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj +++ b/Tests/TryAtSoftware.CleanTests.Benchmark/TryAtSoftware.CleanTests.Benchmark.csproj @@ -6,7 +6,7 @@ - + diff --git a/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj b/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj index a90a0da..0199507 100644 --- a/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj +++ b/Tests/TryAtSoftware.CleanTests.UnitTests/TryAtSoftware.CleanTests.UnitTests.csproj @@ -14,19 +14,19 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj b/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj index c5cc96e..4b529c1 100644 --- a/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj +++ b/TryAtSoftware.CleanTests.Sample/TryAtSoftware.CleanTests.Sample.csproj @@ -9,17 +9,17 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 867a00acde4facf92d01b9878b43ddafbeb78810 Mon Sep 17 00:00:00 2001 From: Tony Troeff Date: Thu, 9 Jan 2025 23:41:11 +0200 Subject: [PATCH 4/5] Applied changes specific to the major update of the mongo driver used in one of the samples. --- .../Configuration/MongoDbEntitiesConfiguration.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Samples/Job Agency/JobAgency.Data/Configuration/MongoDbEntitiesConfiguration.cs b/Samples/Job Agency/JobAgency.Data/Configuration/MongoDbEntitiesConfiguration.cs index 9bb2794..21dcf66 100644 --- a/Samples/Job Agency/JobAgency.Data/Configuration/MongoDbEntitiesConfiguration.cs +++ b/Samples/Job Agency/JobAgency.Data/Configuration/MongoDbEntitiesConfiguration.cs @@ -4,6 +4,7 @@ using JobAgency.Models.Benefits; using JobAgency.Models.Interfaces; using JobAgency.Models.Requirements; +using MongoDB.Bson; using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization.Serializers; @@ -20,6 +21,8 @@ public static void Apply() _isApplied = true; } + BsonSerializer.RegisterSerializer(new GuidSerializer(GuidRepresentation.Standard)); + BsonClassMap.RegisterClassMap( x => { From 10b3677c7ddcef07c46c461f18fcddbf5f8971fe Mon Sep 17 00:00:00 2001 From: Tony Troeff Date: Thu, 9 Jan 2025 23:45:12 +0200 Subject: [PATCH 5/5] Updated workflow files --- .github/workflows/CI.yml | 3 +- .github/workflows/Publish packages.yml | 65 +++++++++++++------------- Samples/Job Agency/docker-compose.yml | 2 +- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c429047..5f00d01 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,7 +16,7 @@ jobs: CONFIGURATION: Release services: mongo: - image: mongo:5.0 + image: mongo:7.0 options: --hostname "mongo_db" ports: - 27017:27017 @@ -33,6 +33,7 @@ jobs: 6.x 7.x 8.x + 9.x - name: Set up JDK 11 uses: actions/setup-java@v4 diff --git a/.github/workflows/Publish packages.yml b/.github/workflows/Publish packages.yml index c08c78f..1ad1168 100644 --- a/.github/workflows/Publish packages.yml +++ b/.github/workflows/Publish packages.yml @@ -1,37 +1,38 @@ name: Publish packages on: - workflow_dispatch: + workflow_dispatch: jobs: - publish: - name: Publish NuGet packages - runs-on: ubuntu-latest - env: - NUGET_KEY: ${{ secrets.NUGET_KEY }} - CONFIGURATION: Release - PACKAGES_DIRECTORY: ./packages - NUGET_SOURCE: https://api.nuget.org/v3/index.json - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.x - 7.x - 8.x - - - name: Restore dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore --configuration "${{ env.CONFIGURATION }}" - - - name: Pack 'Clean tests' - run: dotnet pack --no-build --configuration "${{ env.CONFIGURATION }}" ./TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj -o "${{ env.PACKAGES_DIRECTORY }}" - - - name: Publish all packages - run: dotnet nuget push "${{ env.PACKAGES_DIRECTORY }}/*.nupkg" --source "${{ env.NUGET_SOURCE }}" --api-key "${{ env.NUGET_KEY }}" --skip-duplicate + publish: + name: Publish NuGet packages + runs-on: ubuntu-latest + env: + NUGET_KEY: ${{ secrets.NUGET_KEY }} + CONFIGURATION: Release + PACKAGES_DIRECTORY: ./packages + NUGET_SOURCE: https://api.nuget.org/v3/index.json + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.x + 7.x + 8.x + 9.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration "${{ env.CONFIGURATION }}" + + - name: Pack 'Clean tests' + run: dotnet pack --no-build --configuration "${{ env.CONFIGURATION }}" ./TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj -o "${{ env.PACKAGES_DIRECTORY }}" + + - name: Publish all packages + run: dotnet nuget push "${{ env.PACKAGES_DIRECTORY }}/*.nupkg" --source "${{ env.NUGET_SOURCE }}" --api-key "${{ env.NUGET_KEY }}" --skip-duplicate diff --git a/Samples/Job Agency/docker-compose.yml b/Samples/Job Agency/docker-compose.yml index e2fa7e1..c63a429 100644 --- a/Samples/Job Agency/docker-compose.yml +++ b/Samples/Job Agency/docker-compose.yml @@ -1,6 +1,6 @@ services: mongo: - image: mongo:5.0 + image: mongo:7.0 container_name: ja_mongo hostname: mongo_db volumes: