Skip to content

Commit 93d70f7

Browse files
authored
.NET 8 (#6)
* .NET 8 * Update build scripts +semver:major
1 parent d825e66 commit 93d70f7

7 files changed

Lines changed: 36 additions & 28 deletions

File tree

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
- name: Setup .NET
12-
uses: actions/setup-dotnet@v1
12+
uses: actions/setup-dotnet@v3
1313
with:
14-
dotnet-version: 6.0.x
14+
dotnet-version: 8.0.x
1515
- name: Restore dependencies
1616
run: dotnet restore source
1717
- name: Build

.github/workflows/PreRelease.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
1414
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
1515
- name: Install GitVersion
16-
uses: gittools/actions/gitversion/setup@v0.9.10
16+
uses: gittools/actions/gitversion/setup@v0
1717
with:
1818
versionSpec: "5.x"
1919
- name: Determine Version
2020
id: gitversion
21-
uses: gittools/actions/gitversion/execute@v0.9.10
21+
uses: gittools/actions/gitversion/execute@v0
2222
with:
2323
useConfigFile: true
24-
- name: Setup .NET 6
25-
uses: actions/setup-dotnet@v1
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v3
2626
with:
27-
dotnet-version: 6.0.x
27+
dotnet-version: 8.0.x
2828
- name: Pack
2929
run: dotnet pack source /p:Version=${{ steps.gitversion.outputs.NuGetVersionV2 }}-${{ steps.gitversion.outputs.ShortSha }} /p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }} /p:PackageReleaseNotes="https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ steps.gitversion.outputs.NuGetVersionV2 }}" -o ./releases
3030
- name: Publish

.github/workflows/Release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
1414
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
1515
- name: Install GitVersion
16-
uses: gittools/actions/gitversion/setup@v0.9.10
16+
uses: gittools/actions/gitversion/setup@v0
1717
with:
1818
versionSpec: "5.x"
1919
- name: Determine Version
2020
id: gitversion
21-
uses: gittools/actions/gitversion/execute@v0.9.10
21+
uses: gittools/actions/gitversion/execute@v0
2222
with:
2323
useConfigFile: true
24-
- name: Setup .NET 6
25-
uses: actions/setup-dotnet@v1
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v3
2626
with:
27-
dotnet-version: 6.0.x
27+
dotnet-version: 8.0.x
2828
- name: Pack
2929
run: dotnet pack source /p:Version=${{ steps.gitversion.outputs.majorMinorPatch }} /p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }} /p:PackageReleaseNotes="https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ steps.gitversion.outputs.majorMinorPatch }}" -o ./releases
3030
- name: Publish

samples/With/With.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Worker">
22

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

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
10-
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
11-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
9+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
10+
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/With/Worker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
1818
{
1919
try
2020
{
21-
await _client.GetAsync("https://httpstat.us/200?sleep=3000", stoppingToken);
21+
await _client.GetAsync("https://google.com/?with-minimal-logging=true", stoppingToken);
2222
}
2323
catch (TaskCanceledException)
2424
{

samples/Without/Worker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
1818
{
1919
try
2020
{
21-
await _client.GetAsync("https://httpstat.us/404?sleep=3000", stoppingToken);
21+
await _client.GetAsync("https://google.com/?with-minimal-logging=false", stoppingToken);
2222
}
2323
catch (TaskCanceledException)
2424
{

source/MinimalHttpLogger/MinimalHttpLogger.csproj

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>
@@ -17,14 +17,22 @@
1717
</PropertyGroup>
1818

1919
<PropertyGroup>
20-
<DotNet6Version>6.0.0</DotNet6Version>
20+
<DotNet7Version>7.0.0</DotNet7Version>
21+
<DotNet8Version>8.0.0</DotNet8Version>
2122
</PropertyGroup>
2223

23-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
24-
<PackageReference Include="Microsoft.Extensions.Http" Version="$(DotNet6Version)" />
25-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNet6Version)" />
26-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(DotNet6Version)" />
27-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(DotNet6Version)" />
24+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
25+
<PackageReference Include="Microsoft.Extensions.Http" Version="$(DotNet7Version)" />
26+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNet7Version)" />
27+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(DotNet7Version)" />
28+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(DotNet7Version)" />
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
32+
<PackageReference Include="Microsoft.Extensions.Http" Version="$(DotNet8Version)" />
33+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(DotNet8Version)" />
34+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(DotNet8Version)" />
35+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(DotNet8Version)" />
2836
</ItemGroup>
2937

3038
<ItemGroup>

0 commit comments

Comments
 (0)