Skip to content

Commit

Permalink
Updated build scripts to support .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed May 3, 2024
1 parent 498510e commit 2d07f6e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v3

- name: Install .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet_core_version }}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/Ogooreck.Build/Ogooreck.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bullseye" Version="4.2.0" />
<PackageReference Include="SimpleExec" Version="11.0.0" />
<PackageReference Include="Bullseye" Version="5.0.0" />
<PackageReference Include="SimpleExec" Version="12.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2d07f6e

Please sign in to comment.