Skip to content

Commit 6f74294

Browse files
authored
Drop .NET6+7; Target only .NET8+9; Switch from dotnet-format to csharpier (#103)
1 parent 7677b0c commit 6f74294

29 files changed

+248
-116
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"csharpier": {
6+
"version": "0.30.6",
7+
"commands": [
8+
"dotnet-csharpier"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/dependabot-automerge.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,18 @@ jobs:
1212
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1313
if: ${{ github.actor == 'dependabot[bot]' }}
1414
steps:
15+
- uses: actions/checkout@v4
16+
- name: Verify commit signature.
17+
run: |
18+
curl -s https://github.com/web-flow.gpg | gpg --import
19+
echo "Imported GitHub keys."
20+
21+
echo "Verifying signature of commit: $GITHUB_SHA"
22+
if ! git verify-commit "$GITHUB_SHA"; then
23+
echo "Commit signature verification failed."
24+
exit 1
25+
fi
1526
- name: Approve a PR
1627
run: gh pr review --approve "$PR_URL"
1728
- name: Enable auto-merge for Dependabot PRs
18-
run: gh pr merge --auto --squash "$PR_URL"
29+
run: gh pr merge --auto --squash "$PR_URL"

.github/workflows/formatter.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: dotnet-format
1+
name: csharpier
22

33
on: [push, pull_request]
44

@@ -7,13 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- name: Setup .NET
10+
- name: Setup .NET 8
1111
uses: actions/setup-dotnet@v4
1212
with:
1313
dotnet-version: 8.0.100
14-
- name: Install dotnet-format
15-
run: |
16-
dotnet tool install -g dotnet-format
17-
- name: Run dotnet-format
18-
working-directory: ./TransformerBeeClient
19-
run: dotnet-format TransformerBeeClient.sln --check
14+
- name: Restore .NET tools
15+
run: dotnet tool restore
16+
- name: Run CSharpier
17+
run: dotnet csharpier . --check

.github/workflows/integrationtests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ubuntu-latest]
14-
dotnet-version: ["6.0.201", "7.0.100", "8.0.100"]
14+
dotnet-version: ["9"]
1515
runs-on: ${{ matrix.os }}
1616
steps:
1717
- name: Checkout code
@@ -25,13 +25,13 @@ jobs:
2525
- name: Log into registry
2626
# GHCR_PAT is a personal access token for the Github Container Registry; You can create it using the following steps:
2727
# 1) Go to https://github.com/settings/tokens
28-
# 2) Create a new token (classic as of 2024-01-31)
28+
# 2) Create a new token (classic as of 2025-04-02)
2929
# 3) Select the following scopes: read:packages
3030
# GHCR_USR is the username for the Github Container Registry; it has to match the PAT and is the username of the Github account that created the PAT
3131
# You can update the tokens in the repository settings:
3232
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_PAT
3333
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_USR
34-
# Tokens will expire 2025-01-31
34+
# Tokens will expire 2026-04-01
3535
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USR }} --password-stdin
3636
- name: Start containers
3737
run: docker compose -f "TransformerBeeClient/TransformerBeeClient.IntegrationTest/docker-compose.yml" up -d

.github/workflows/release_nuget.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
- name: Setup .NET Core
1313
uses: actions/setup-dotnet@v4
1414
with:
15-
dotnet-version: 8.0.100
15+
dotnet-version: 9
1616
- name: Build/Check for compile errors (dotnet build)
1717
working-directory: "TransformerBeeClient"
1818
run: dotnet build --configuration Release
1919
- name: Log into registry
2020
# GHCR_PAT is a personal access token for the Github Container Registry; You can create it using the following steps:
2121
# 1) Go to https://github.com/settings/tokens
22-
# 2) Create a new token (classic as of 2024-01-31)
22+
# 2) Create a new token (classic as of 2025-04-02)
2323
# 3) Select the following scopes: read:packages
2424
# GHCR_USR is the username for the Github Container Registry; it has to match the PAT and is the username of the Github account that created the PAT
2525
# You can update the tokens in the repository settings:
2626
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_PAT
2727
# https://github.com/Hochfrequenz/transformer.bee_client.net/settings/secrets/actions/GHCR_USR
28-
# Tokens will expire 2025-01-31
28+
# Tokens will expire 2026-04-01
2929
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USR }} --password-stdin
3030
- name: Start containers
3131
run: docker compose -f "TransformerBeeClient/TransformerBeeClient.IntegrationTest/docker-compose.yml" up -d

.github/workflows/unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest]
13-
dotnet-version: ["6.0.201", "7.0.100", "8.0.100"]
13+
dotnet-version: ["9"]
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- name: Checkout code

TransformerBeeClient/ExampleAspNetCoreApplication.Test/ApplicationTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Net;
1+
using System.Net.Http.Json;
22
using System.Text.Json;
33
using System.Text.Json.Serialization;
44
using FluentAssertions;
@@ -20,10 +20,10 @@ public ApplicationTest(WebApplicationFactory<Program> factory)
2020
public async Task Test_That_Setup_Works_As_Designed()
2121
{
2222
var client = Factory.CreateDefaultClient();
23-
var response = await client.GetAsync("/talkToTransformerBee");
24-
response.StatusCode.Should().Be(HttpStatusCode.OK);
25-
var content = await response.Content.ReadAsStringAsync();
26-
var bo4e = JsonSerializer.Deserialize<BOneyComb>(content, new JsonSerializerOptions { Converters = { new JsonStringEnumConverter() } });
23+
var bo4e = await client.GetFromJsonAsync<BOneyComb>(
24+
"/talkToTransformerBee",
25+
new JsonSerializerOptions { Converters = { new JsonStringEnumConverter() } }
26+
);
2727
bo4e.Should().NotBeNull();
2828
}
2929
}

TransformerBeeClient/ExampleAspNetCoreApplication.Test/ExampleAspNetCoreApplication.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

88
<IsPackable>false</IsPackable>
99
<IsTestProject>true</IsTestProject>
10+
<LangVersion>latest</LangVersion>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
global using Xunit;
1+
global using Xunit;

TransformerBeeClient/ExampleAspNetCoreApplication/ExampleAspNetCoreApplication.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
54
<Nullable>enable</Nullable>
65
<ImplicitUsings>enable</ImplicitUsings>
76
<PreserveCompilationContext>true</PreserveCompilationContext>
7+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
8+
<LangVersion>latest</LangVersion>
89
</PropertyGroup>
910
<ItemGroup>
1011
<ProjectReference Include="..\TransformerBeeClient\TransformerBeeClient.csproj"/>

0 commit comments

Comments
 (0)