Skip to content

Commit

Permalink
Updated to .NET 8
Browse files Browse the repository at this point in the history
- Bumped packages by major versions
- Adjusted pipeline configurations. Azure DevOps will run .NET 6, GH Actions .NET 8 and 7
  • Loading branch information
oskardudycz committed Nov 23, 2023
1 parent 22c1445 commit a6d07d0
Show file tree
Hide file tree
Showing 45 changed files with 294 additions and 212 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
pull_request:
branches:
- master

jobs:
linting:
name: "Markdown linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out the code
- name: Lint Code Base
uses: docker://ghcr.io/igorshubovych/markdownlint-cli:latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docs build and deploy
on:
# run it on push to the default repository branch
push:
branches: [master]
branches: [ master ]
workflow_dispatch:
inputs:
publish_docs:
Expand All @@ -26,10 +26,10 @@ jobs:
# define the test matrix
matrix:
# selected operation systems to run CI
os: [ubuntu-latest]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on-manual-do-nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Marten NuGet Manual Publish

on: [workflow_dispatch]
on: [ workflow_dispatch ]

env:
config: Release
Expand All @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 7.0.x
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Run Pack
run: ./build.sh --no-color pack
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/on-push-do-ci-build-pg10.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net6.0 pg10
name: build_net8.0 pg10

on:
push:
Expand Down Expand Up @@ -43,8 +43,8 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
with:
Expand All @@ -54,7 +54,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x


- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -77,5 +82,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net7.0 -c Release -- ci
run: dotnet run --project build/build.csproj -f net8.0 -c Release -- ci
shell: bash
11 changes: 8 additions & 3 deletions .github/workflows/on-push-do-ci-build-pg11.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net6.0 pg11
name: build_net8.0 pg11

on:
push:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
with:
Expand All @@ -54,6 +54,11 @@ jobs:
with:
dotnet-version: 7.0.x

- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -76,5 +81,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net7.0 -c Release -- ci
run: dotnet run --project build/build.csproj -f net8.0 -c Release -- ci
shell: bash
13 changes: 9 additions & 4 deletions .github/workflows/on-push-do-ci-build-pg12.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net6.0 pg12
name: build_net8.0 pg12

on:
push:
Expand Down Expand Up @@ -43,8 +43,8 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
with:
Expand All @@ -55,6 +55,11 @@ jobs:
with:
dotnet-version: 7.0.x

- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -77,5 +82,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net7.0 -c Release -- ci
run: dotnet run --project build/build.csproj -f net8.0 -c Release -- ci
shell: bash
23 changes: 17 additions & 6 deletions .github/workflows/on-push-do-ci-build-pg9.6.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net6.0 pg9.6
name: build_net8.0 pg9.6

on:
push:
Expand Down Expand Up @@ -26,7 +26,9 @@ jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20


name: build_${{ matrix.dotnet_version }} pg9.6

services:
postgres:
image: mysticmind/postgres-plv8:9.6-1.4
Expand All @@ -41,10 +43,14 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
dotnet_version: [ net7.0, net8.0 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
with:
Expand All @@ -55,6 +61,11 @@ jobs:
with:
dotnet-version: 7.0.x

- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -77,5 +88,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net7.0 -c Release -- ci
run: dotnet run --project build/build.csproj -f ${{ matrix.dotnet_version }} -c Release -- ci
shell: bash
14 changes: 10 additions & 4 deletions .github/workflows/on-push-do-ci-build-systemtextjson.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net6.0 pg12 System.Text.Json
name: build_net8.0 pg12 System.Text.Json

on:
push:
Expand Down Expand Up @@ -41,9 +41,15 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
dotnet_version: [ net7.0, net8.0 ]

name: build_${{ matrix.dotnet_version }} pg12 System.Text.Json

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
Expand Down Expand Up @@ -78,5 +84,5 @@ jobs:
env:
DEFAULT_SERIALIZER: "SystemTextJson"
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net7.0 -c Release -- ci
run: dotnet run --project build/build.csproj -f ${{ matrix.dotnet_version }} -c Release -- ci
shell: bash
2 changes: 1 addition & 1 deletion Analysis.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ExcludeAssets>none</ExcludeAssets>
<IncludeAssets>all</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<ExcludeAssets>none</ExcludeAssets>
<IncludeAssets>all</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<VersionPrefix>6.4.1</VersionPrefix>
<VersionPrefix>7.0.0-alpha.1</VersionPrefix>
<LangVersion>11.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko</Authors>
<PackageIconUrl>https://martendb.io/logo.png</PackageIconUrl>
Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ trigger:
- master
paths:
exclude:
- docs/*
- documentation/*
- docs/*
- documentation/*

pr:
- master
Expand Down Expand Up @@ -75,10 +75,10 @@ jobs:
postgres: $[ variables['postgresService'] ]
steps:
- task: UseDotNet@2
displayName: Install .NET 7.0.x
displayName: Install .NET 8.0.x
inputs:
packageType: 'sdk'
version: '7.x'
version: '8.x'
- task: NodeTool@0
displayName: Install Node.js
inputs:
Expand All @@ -90,8 +90,8 @@ jobs:
docker exec $PG_CONTAINER_NAME psql -U postgres -c "DO 'plv8.elog(NOTICE, plv8.version);' LANGUAGE plv8;"
displayName: Create db and add plv8 extension
- script: |
./build.sh --no-color ci
./build.sh --no-color test-extension-libs
dotnet run --project build/build.csproj -f net6.0 -c Release -- ci
dotnet run --project build/build.csproj -f net6.0 -c Release -- test-extension-libs
displayName: Build
env:
DEFAULT_SERIALIZER: $(serializer)
5 changes: 4 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ foreach ($item in $versions) {
elseif ($item.Value.StartsWith("7.")) {
$target_framework = "net7.0"
}
elseif ($item.Value.StartsWith("8.")) {
$target_framework = "net8.0"
}
}

if ([string]::IsNullOrEmpty($target_framework)) {
Write-Output "BUILD FAILURE: .NET 6 or .NET 7 SDK required to run build"
Write-Output "BUILD FAILURE: .NET 6, .NET 7 or .NET 8 SDK required to run build"
exit 1
}

Expand Down
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ for version in "${versions[@]}"; do
target_framework="net6.0"
elif [[ $version = 7.* ]]; then
target_framework="net7.0"
elif [[ $version = 8.* ]]; then
target_framework="net8.0"
fi
done

if [ -z "$target_framework" ]; then
echo "BUILD FAILURE: .NET 6 or .NET 7 SDK required to run build"
echo "BUILD FAILURE: .NET 6, .NET 7 or .NET 8 SDK required to run build"
exit 1
fi

Expand Down
28 changes: 14 additions & 14 deletions build/build.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

<ItemGroup>
<Compile Include="build.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="build.cs"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bullseye" Version="4.0.0" />
<PackageReference Include="Npgsql" Version="4.1.3.1" />
<PackageReference Include="SimpleExec" Version="10.0.0-beta.2" />
<PackageReference Include="Westwind.Utilities" Version="3.0.37" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bullseye" Version="4.0.0"/>
<PackageReference Include="Npgsql" Version="4.1.3.1"/>
<PackageReference Include="SimpleExec" Version="10.0.0-beta.2"/>
<PackageReference Include="Westwind.Utilities" Version="3.0.37"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/AspNetCoreWithMarten/AspNetCoreWithMarten.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Loading

0 comments on commit a6d07d0

Please sign in to comment.