Skip to content

Commit aa4ba43

Browse files
committed
Update to .NET 10, speed up workflows, fix CVE and warnings
Target net10.0 in all projects and bump Microsoft.*/System.* packages to 10.0.11. Move the nullable test server to an explicit ProgramNullable.Main since .NET 10 makes the generated Program class public, which collided with the other test server in the Tests project. Workflows: single 10.0.x SDK (fixes nbgv "install or update .NET" failure in Create Release), NuGet cache via packages.lock.json, solution filters for CI and release, one pack + push for all packages, actions bumped to v4 and create-release replaced with softprops/action-gh-release. HotChocolate 15.1.11 -> 15.1.17 (GHSA-qr3m-xw4c-jqw3). Remove redundant System.Text.Json references. Generator now emits [Obsolete] on input factory extension methods for deprecated fields. Fix CA2024 in SSEClient and CS8625 in ErrorHandlingTests.
1 parent 5220db9 commit aa4ba43

40 files changed

Lines changed: 4194 additions & 105 deletions

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a .NET project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
41
name: Build
52

63
on:
@@ -9,22 +6,33 @@ on:
96
pull_request:
107
branches: [ "main" ]
118

9+
env:
10+
DOTNET_NOLOGO: 1
11+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
12+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
13+
1214
jobs:
1315
build:
1416

1517
runs-on: ubuntu-latest
1618

1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921
with:
2022
fetch-depth: 0
23+
2124
- name: Setup .NET
22-
uses: actions/setup-dotnet@v3
25+
uses: actions/setup-dotnet@v4
2326
with:
24-
dotnet-version: 9.0.x
25-
- name: Restore dependencies
26-
run: dotnet restore
27+
dotnet-version: 10.0.x
28+
cache: true
29+
cache-dependency-path: '**/packages.lock.json'
30+
31+
- name: Restore
32+
run: dotnet restore Linq2GraphQL.CI.slnf --locked-mode
33+
2734
- name: Build
28-
run: dotnet build --no-restore
35+
run: dotnet build Linq2GraphQL.CI.slnf --no-restore
36+
2937
- name: Test
30-
run: dotnet test --no-build --verbosity normal
38+
run: dotnet test Linq2GraphQL.CI.slnf --no-build --verbosity normal

‎.github/workflows/docs.yml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,32 @@ on:
55
branches:
66
- main
77

8+
env:
9+
DOTNET_NOLOGO: 1
10+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
11+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
12+
813
jobs:
914
deploy:
1015
runs-on: ubuntu-latest
1116
steps:
12-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1318
with:
1419
fetch-depth: 0
1520

16-
- name: Setup .NET Core
17-
uses: actions/setup-dotnet@v3
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
1823
with:
19-
dotnet-version: 9.0.x
24+
dotnet-version: 10.0.x
25+
cache: true
26+
cache-dependency-path: '**/packages.lock.json'
2027

2128
- name: Publish
2229
working-directory: docs/Linq2GraphQL.Docs
2330
run: dotnet publish -c:Release -o:publish
2431

2532
- name: Deploy
26-
uses: peaceiris/actions-gh-pages@v3
33+
uses: peaceiris/actions-gh-pages@v4
2734
with:
2835
github_token: ${{ secrets.GITHUB_TOKEN }}
2936
publish_dir: docs/Linq2GraphQL.Docs/publish/wwwroot

‎.github/workflows/release.yml‎

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,55 @@
11
name: Create Release
22

33
on: [ workflow_dispatch ]
4+
5+
env:
6+
DOTNET_NOLOGO: 1
7+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
9+
10+
permissions:
11+
contents: write
12+
413
jobs:
514
build:
615

716
runs-on: ubuntu-latest
817

918
steps:
10-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1120
with:
1221
fetch-depth: 0
1322

14-
- name: Nerdbank.GitVersioning
15-
uses: dotnet/nbgv@v0.4.0
16-
1723
- name: Setup .NET
18-
uses: actions/setup-dotnet@v2
24+
uses: actions/setup-dotnet@v4
1925
with:
20-
dotnet-version: 9.0.x
26+
dotnet-version: 10.0.x
27+
cache: true
28+
cache-dependency-path: '**/packages.lock.json'
2129

2230
- uses: dotnet/nbgv@master
2331
id: nbgv
2432
- run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}'
2533

26-
- name: Pack Linq2GraphQL.Client
27-
working-directory: src/Linq2GraphQL.Client
28-
run: dotnet pack -c Release
29-
30-
- name: Push Linq2GraphQL.Client
31-
working-directory: src/Linq2GraphQL.Client/bin/Release
32-
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
33-
34-
- name: Pack Linq2GraphQL.Client.Subscriptions
35-
working-directory: src/Linq2GraphQL.Client.Subscriptions
36-
run: dotnet pack -c Release
37-
38-
- name: Push Linq2GraphQL.Client.Subscriptions
39-
working-directory: src/Linq2GraphQL.Client.Subscriptions/bin/Release
40-
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
34+
- name: Restore
35+
run: dotnet restore Linq2GraphQL.Release.slnf --locked-mode
4136

42-
- name: Pack Linq2GraphQL.Generator
43-
working-directory: src/Linq2GraphQL.Generator
44-
run: dotnet pack -c Release
37+
- name: Pack
38+
run: dotnet pack Linq2GraphQL.Release.slnf -c Release --no-restore -o artifacts
4539

46-
- name: Push Linq2GraphQL.Generator
47-
working-directory: src/Linq2GraphQL.Generator/bin/Release
48-
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
40+
- name: Push to NuGet
41+
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
4942

5043
- name: Extract branch name
5144
shell: bash
5245
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
5346
id: extract_branch
5447

5548
- name: Create Release
56-
uses: actions/create-release@master
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
uses: softprops/action-gh-release@v2
5950
with:
6051
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
61-
release_name: Release ${{ steps.nbgv.outputs.SemVer2 }}
52+
name: Release ${{ steps.nbgv.outputs.SemVer2 }}
6253
draft: false
63-
prerelease: ${{ !startsWith(steps.extract_branch.outputs.branch, 'release/') }}
54+
prerelease: ${{ !startsWith(steps.extract_branch.outputs.branch, 'release/') }}
55+
files: artifacts/*.nupkg

‎Directory.Build.props‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
4+
</PropertyGroup>
5+
</Project>

‎Directory.Packages.props‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,27 @@
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageVersion>
15-
<PackageVersion Include="HotChocolate.AspNetCore" Version="15.1.11" />
16-
<PackageVersion Include="HotChocolate.Data" Version="15.1.11" />
17-
<PackageVersion Include="HotChocolate.Types.Scalars" Version="15.1.11" />
18-
<PackageVersion Include="HotChocolate.Types.Analyzers" Version="15.1.11" />
15+
<PackageVersion Include="HotChocolate.AspNetCore" Version="15.1.17" />
16+
<PackageVersion Include="HotChocolate.Data" Version="15.1.17" />
17+
<PackageVersion Include="HotChocolate.Types.Scalars" Version="15.1.17" />
18+
<PackageVersion Include="HotChocolate.Types.Analyzers" Version="15.1.17" />
1919
<PackageVersion Include="Macross.Json.Extensions" Version="3.0.0" />
20-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.9" />
21-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.9" />
22-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
23-
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
24-
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
25-
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.9" />
26-
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.9" />
27-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
28-
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.9" />
29-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.9" />
30-
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.9" />
20+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.11" />
21+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.11" />
22+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.11" />
23+
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.11" />
24+
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.11" />
25+
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.11" />
26+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.11" />
27+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.11" />
28+
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.11" />
29+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.11" />
30+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.11" />
3131
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
3232
<PackageVersion Include="Moq" Version="4.20.72" />
3333
<PackageVersion Include="Shouldly" Version="4.3.0" />
34-
<PackageVersion Include="System.CodeDom" Version="9.0.9" />
34+
<PackageVersion Include="System.CodeDom" Version="10.0.11" />
3535
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
36-
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
3736
<PackageVersion Include="TabBlazor" Version="0.8.1.1-alpha" />
3837
<PackageVersion Include="Websocket.Client" Version="5.3.0" />
3938
<PackageVersion Include="xunit" Version="2.9.3" />

‎Linq2GraphQL.CI.slnf‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"solution": {
3+
"path": "Linq2GraphQL.sln",
4+
"projects": [
5+
"src\\Linq2GraphQL.Client\\Linq2GraphQL.Client.csproj",
6+
"src\\Linq2GraphQL.Client.Subscriptions\\Linq2GraphQL.Client.Subscriptions.csproj",
7+
"src\\Linq2GraphQL.Generator\\Linq2GraphQL.Generator.csproj",
8+
"test\\Linq2GraphQL.Console\\Linq2GraphQL.Console.csproj",
9+
"test\\Linq2GraphQL.TestClient\\Linq2GraphQL.TestClient.csproj",
10+
"test\\Linq2GraphQL.TestClientNullable\\Linq2GraphQL.TestClientNullable.csproj",
11+
"test\\Linq2GraphQL.TestServer\\Linq2GraphQL.TestServer.csproj",
12+
"test\\Linq2GraphQL.TestServer.Shared\\Linq2GraphQL.TestServer.Shared.csproj",
13+
"test\\Linq2GraphQL.TestServerNullable\\Linq2GraphQL.TestServerNullable.csproj",
14+
"test\\Linq2GraphQL.Tests\\Linq2GraphQL.Tests.csproj"
15+
]
16+
}
17+
}

‎Linq2GraphQL.Release.slnf‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"solution": {
3+
"path": "Linq2GraphQL.sln",
4+
"projects": [
5+
"src\\Linq2GraphQL.Client\\Linq2GraphQL.Client.csproj",
6+
"src\\Linq2GraphQL.Client.Subscriptions\\Linq2GraphQL.Client.Subscriptions.csproj",
7+
"src\\Linq2GraphQL.Generator\\Linq2GraphQL.Generator.csproj"
8+
]
9+
}
10+
}

‎StartGG/StartGG.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>disable</Nullable>
88
</PropertyGroup>

0 commit comments

Comments
 (0)