Skip to content

Commit 60e0f34

Browse files
authored
Add .net 8 target (#23)
* Add .Net8 SDK * Use .Net8 target * Code style
1 parent b4e2371 commit 60e0f34

File tree

7 files changed

+29
-21
lines changed

7 files changed

+29
-21
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ jobs:
1414
env:
1515
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
1616
steps:
17-
- name: Setup .Net 7.0.x
17+
- name: Setup .Net
1818
uses: actions/setup-dotnet@v3
1919
with:
20-
dotnet-version: '7.0.x'
20+
dotnet-version: |
21+
7.0.x
22+
8.0.x
2123
- uses: actions/checkout@v4
2224
- name: Restore
2325
run: dotnet restore --nologo
@@ -32,10 +34,10 @@ jobs:
3234
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
3335
steps:
3436
- uses: actions/checkout@v4
35-
- name: Setup .Net 7.0.x
37+
- name: Setup .Net 8.0.x
3638
uses: actions/setup-dotnet@v3
3739
with:
38-
dotnet-version: '7.0.x'
40+
dotnet-version: '8.0.x'
3941
- name: Restore
4042
run: dotnet restore --nologo
4143
- name: .Net Format

.github/workflows/nightly-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ jobs:
1111
env:
1212
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
1313
steps:
14-
- name: Setup .Net 7.0.x
14+
- name: Setup .Net
1515
uses: actions/setup-dotnet@v3
1616
with:
17-
dotnet-version: '7.0.x'
17+
dotnet-version: |
18+
7.0.x
19+
8.0.x
1820
- uses: actions/checkout@v4
1921
- name: Fetch all history for all tags and branches
2022
run: git fetch --prune --unshallow

.github/workflows/pr-build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ jobs:
1414
env:
1515
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
1616
steps:
17-
- name: Setup .Net 7.0.x
17+
- name: Setup .Net
1818
uses: actions/setup-dotnet@v3
1919
with:
20-
dotnet-version: '7.0.x'
20+
dotnet-version: |
21+
7.0.x
22+
8.0.x
2123
- uses: actions/checkout@v4
2224
- name: Restore
2325
run: dotnet restore --nologo
@@ -35,10 +37,10 @@ jobs:
3537
with:
3638
ref: ${{ github.head_ref }}
3739
fetch-depth: 0
38-
- name: Setup .Net 7.0.x
40+
- name: Setup .Net 8.0.x
3941
uses: actions/setup-dotnet@v3
4042
with:
41-
dotnet-version: '7.0.x'
43+
dotnet-version: '8.0.x'
4244
- name: Restore
4345
run: dotnet restore --nologo
4446
- name: Add .Net Format Problem Matcher

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
env:
1414
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
1515
steps:
16-
- name: Setup .Net 7.0.x
16+
- name: Setup .Net
1717
uses: actions/setup-dotnet@v3
1818
with:
19-
dotnet-version: '7.0.x'
19+
dotnet-version: |
20+
7.0.x
21+
8.0.x
2022
- uses: actions/checkout@v4
2123
- name: Fetch all history for all tags and branches
2224
run: git fetch --prune --unshallow

src/ReportingApi.Tests/ReportingApi.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
5-
<LangVersion>11.0</LangVersion>
4+
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
5+
<LangVersion>12.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<PackageLicense>MIT</PackageLicense>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\ReportingApi\ReportingApi.csproj" />
1212
</ItemGroup>
13-
13+
1414
<ItemGroup>
1515
<PackageReference Include="coverlet.collector" Version="6.0.0">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/ReportingApi/IReportBody.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
namespace ReportingApi;
22

3-
public interface IReportBody
4-
{
5-
}
3+
public interface IReportBody;

src/ReportingApi/ReportingApi.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
5-
<LangVersion>11.0</LangVersion>
4+
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
5+
<LangVersion>12.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<PackageLicense>MIT</PackageLicense>
88
<RepositoryUrl>https://github.com/aviationexam/reporting-api</RepositoryUrl>
@@ -19,6 +19,8 @@
1919
<PackageReference Include="System.Text.Json" Version="7.0.3" />
2020
</ItemGroup>
2121

22-
22+
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
23+
<PackageReference Include="System.Text.Json" Version="8.0.0" />
24+
</ItemGroup>
2325

2426
</Project>

0 commit comments

Comments
 (0)