diff --git a/.github/workflows/build.dotnet.yml b/.github/workflows/build.dotnet.yml index 9e5546c..5f19753 100644 --- a/.github/workflows/build.dotnet.yml +++ b/.github/workflows/build.dotnet.yml @@ -15,14 +15,19 @@ jobs: uses: actions/checkout@v3 - name: Install .NET 6 - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: "6.0.x" - name: Install .NET 7 - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: "7.0.x" - - name: Restore NuGet packages + - name: Install .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Build and Test run: ./build.sh test diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index a0d0d9f..a8b0303 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -6,7 +6,7 @@ env: config: Release DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - dotnet_core_version: 7.0.x + dotnet_core_version: 8.0.x jobs: publish_job: @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnet_core_version }} diff --git a/README.md b/README.md index 17f844d..f43b091 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -![Github Actions](https://github.com/oskardudycz/Ogooreck/actions/workflows/build.dotnet.yml/badge.svg?branch=main) [![blog](https://img.shields.io/badge/blog-event--driven.io-brightgreen)](https://event-driven.io/?utm_source=event_sourcing_net) [![blog](https://img.shields.io/badge/%F0%9F%9A%80-Architecture%20Weekly-important)](https://www.architecture-weekly.com/?utm_source=event_sourcing_net) +[![Twitter Follow](https://img.shields.io/twitter/follow/oskar_at_net?style=social)](https://twitter.com/oskar_at_net) ![Github Actions](https://github.com/oskardudycz/Ogooreck/actions/workflows/build.dotnet.yml/badge.svg?branch=main) [![blog](https://img.shields.io/badge/blog-event--driven.io-brightgreen)](https://event-driven.io/?utm_source=event_sourcing_net) [![blog](https://img.shields.io/badge/%F0%9F%9A%80-Architecture%20Weekly-important)](https://www.architecture-weekly.com/?utm_source=event_sourcing_net) [![Nuget Package](https://badgen.net/nuget/v/ogooreck)](https://www.nuget.org/packages/Ogooreck/) -[![Nuget](https://img.shields.io/nuget/dt/ogooreck)](https://www.nuget.org/packages/Ogooreck/) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/oskardudycz/) +[![Nuget](https://img.shields.io/nuget/dt/ogooreck)](https://www.nuget.org/packages/Ogooreck/) # 🥒 Ogooreck diff --git a/build.sh b/build.sh index a0ac357..26adc95 100755 --- a/build.sh +++ b/build.sh @@ -2,10 +2,10 @@ set -euo pipefail version="$(dotnet --version)" -if [[ $version = 7.* ]]; then - target_framework="net7.0" +if [[ $version = 8.* ]]; then + target_framework="net8.0" else - echo "BUILD FAILURE: .NET 7 SDK required to run build" + echo "BUILD FAILURE: .NET 8 SDK required to run build" exit 1 fi diff --git a/src/Ogooreck.Build/Ogooreck.Build.csproj b/src/Ogooreck.Build/Ogooreck.Build.csproj index 0a07b09..69dac85 100644 --- a/src/Ogooreck.Build/Ogooreck.Build.csproj +++ b/src/Ogooreck.Build/Ogooreck.Build.csproj @@ -2,13 +2,13 @@ Exe - net7.0 + net7.0;net8.0 false - - + + diff --git a/src/Ogooreck.Build/Program.cs b/src/Ogooreck.Build/Program.cs index bffca4e..1c5073f 100644 --- a/src/Ogooreck.Build/Program.cs +++ b/src/Ogooreck.Build/Program.cs @@ -1,7 +1,7 @@ using static Bullseye.Targets; using static SimpleExec.Command; -const string framework = "net7.0"; +const string framework = "net8.0"; const string configuration = "Release"; Target("default", DependsOn("compile")); diff --git a/src/Ogooreck.Sample.Api.Tests/Ogooreck.Sample.Api.Tests.csproj b/src/Ogooreck.Sample.Api.Tests/Ogooreck.Sample.Api.Tests.csproj index a7d1bb0..1a67f36 100644 --- a/src/Ogooreck.Sample.Api.Tests/Ogooreck.Sample.Api.Tests.csproj +++ b/src/Ogooreck.Sample.Api.Tests/Ogooreck.Sample.Api.Tests.csproj @@ -1,15 +1,15 @@ - net7.0 + net8.0 - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,7 +22,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Ogooreck.Sample.Api/Ogooreck.Sample.Api.csproj b/src/Ogooreck.Sample.Api/Ogooreck.Sample.Api.csproj index 3e60ad0..21ad649 100644 --- a/src/Ogooreck.Sample.Api/Ogooreck.Sample.Api.csproj +++ b/src/Ogooreck.Sample.Api/Ogooreck.Sample.Api.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 diff --git a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccount.fs b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccount.fs index b76021f..7626ebd 100644 --- a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccount.fs +++ b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccount.fs @@ -47,7 +47,7 @@ type BankAccount = let evolve bankAccount bankAccountEvent : BankAccount = match bankAccount, bankAccountEvent with - | Initial _, BankAccountOpened event -> + | Initial, BankAccountOpened event -> Open {| Id = event.BankAccountId Balance = 0M diff --git a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccountDecider.fs b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccountDecider.fs index c3f74a2..33ea0e0 100644 --- a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccountDecider.fs +++ b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Deciders/BankAccountDecider.fs @@ -33,7 +33,7 @@ let openBankAccount (command: OpenBankAccount) bankAccount : Event = match bankAccount with | Open _ -> invalidOp "Account is already opened!" | Closed _ -> invalidOp "Account is already closed!" - | Initial _ -> + | Initial -> BankAccountOpened { BankAccountId = command.BankAccountId AccountNumber = command.AccountNumber @@ -44,7 +44,7 @@ let openBankAccount (command: OpenBankAccount) bankAccount : Event = let recordDeposit (command: RecordDeposit) bankAccount : Event = match bankAccount with - | Initial _ -> invalidOp "Account is not opened!" + | Initial -> invalidOp "Account is not opened!" | Closed _ -> invalidOp "Account is closed!" | Open state -> DepositRecorded @@ -56,7 +56,7 @@ let recordDeposit (command: RecordDeposit) bankAccount : Event = let withdrawCashFromAtm (command: WithdrawCashFromAtm) bankAccount : Event = match bankAccount with - | Initial _ -> invalidOp "Account is not opened!" + | Initial -> invalidOp "Account is not opened!" | Closed _ -> invalidOp "Account is closed!" | Open state -> if (state.Balance < command.Amount) then @@ -71,7 +71,7 @@ let withdrawCashFromAtm (command: WithdrawCashFromAtm) bankAccount : Event = let closeBankAccount (command: CloseBankAccount) bankAccount : Event = match bankAccount with - | Initial _ -> invalidOp "Account is not opened!" + | Initial -> invalidOp "Account is not opened!" | Closed _ -> invalidOp "Account is already closed!" | Open state -> BankAccountClosed diff --git a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Ogooreck.Sample.BusinessLogic.FSharp.Tests.fsproj b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Ogooreck.Sample.BusinessLogic.FSharp.Tests.fsproj index e72770a..9d9eee4 100644 --- a/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Ogooreck.Sample.BusinessLogic.FSharp.Tests.fsproj +++ b/src/Ogooreck.Sample.BusinessLogic.FSharp.Tests/Ogooreck.Sample.BusinessLogic.FSharp.Tests.fsproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 @@ -15,17 +15,17 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/Ogooreck.Sample.BusinessLogic.Tests/Ogooreck.Sample.BusinessLogic.Tests.csproj b/src/Ogooreck.Sample.BusinessLogic.Tests/Ogooreck.Sample.BusinessLogic.Tests.csproj index b37dbe7..65bb81f 100644 --- a/src/Ogooreck.Sample.BusinessLogic.Tests/Ogooreck.Sample.BusinessLogic.Tests.csproj +++ b/src/Ogooreck.Sample.BusinessLogic.Tests/Ogooreck.Sample.BusinessLogic.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable @@ -9,13 +9,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Ogooreck/Factories/ObjectFactory.cs b/src/Ogooreck/Factories/ObjectFactory.cs index d15e2bf..2d1351c 100644 --- a/src/Ogooreck/Factories/ObjectFactory.cs +++ b/src/Ogooreck/Factories/ObjectFactory.cs @@ -19,7 +19,9 @@ private static Func Creator() if (t.HasDefaultConstructor()) return Expression.Lambda>(Expression.New(t)).Compile(); +#pragma warning disable SYSLIB0050 return () => (T)FormatterServices.GetUninitializedObject(t); +#pragma warning restore SYSLIB0050 } } diff --git a/src/Ogooreck/Ogooreck.csproj b/src/Ogooreck/Ogooreck.csproj index e1d386f..9b56985 100644 --- a/src/Ogooreck/Ogooreck.csproj +++ b/src/Ogooreck/Ogooreck.csproj @@ -2,7 +2,7 @@ 0.8.1 - net6.0;net7.0 + net6.0;net7.0;net8.0 true true true @@ -11,7 +11,7 @@ true true true - 11.0 + 12.0 Oskar Dudycz https://github.com/oskardudycz/Ogooreck @@ -26,16 +26,20 @@ - + - + - + + + + +