Skip to content

Commit b2c22ef

Browse files
committed
feat: add .NET 10 RC support and OIDC NuGet authentication
- Add .NET 10.0 RC SDK support via global.json with rollForward policy - Add net10.0 target framework to DPI.csproj - Update CI/CD to remove .NET 6.0 and standardize on .NET 8.0/9.0/10.0 - Replace static NuGet API key with OIDC-based authentication - Add required GitHub Actions permissions for OIDC (id-token, packages) - Add CancellationToken parameter to NuGetAnalyzeCommand.ExecuteAsync This prepares the project for .NET 10 release while improving security by using OIDC authentication for NuGet package publishing.
1 parent f4e7d41 commit b2c22ef

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
build:
1313
name: Build
1414
runs-on: ${{ matrix.os }}
15+
permissions:
16+
contents: write
17+
id-token: write
18+
packages: write
1519
strategy:
1620
fail-fast: false
1721
matrix:
@@ -22,21 +26,28 @@ jobs:
2226
with:
2327
fetch-depth: 0
2428

25-
- name: Install .NET SDK 6.0.x
29+
- name: Install .NET SDK 8.0.x
2630
uses: actions/setup-dotnet@v5
2731
with:
28-
dotnet-version: '6.0.x'
32+
dotnet-version: '8.0.x'
2933

30-
- name: Install .NET SDK 8.0.x
34+
- name: Install .NET SDK 9.0.x
3135
uses: actions/setup-dotnet@v5
3236
with:
33-
dotnet-version: '8.0.x'
37+
dotnet-version: '9.0.x'
3438

3539
- name: Install .NET SDK
3640
uses: actions/setup-dotnet@v5
3741
with:
3842
global-json-file: global.json
3943

44+
- name: NuGet login (OIDC → temp API key)
45+
uses: NuGet/login@v1
46+
id: login
47+
if: matrix.os == 'windows-latest' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
48+
with:
49+
user: ${{secrets.NUGET_USER}}
50+
4051
- name: Run Cake script
4152
uses: cake-build/cake-action@v3
4253
env:
@@ -45,7 +56,7 @@ jobs:
4556
GH_PACKAGES_NUGET_SOURCE: ${{ secrets.GH_PACKAGES_NUGET_SOURCE }}
4657
GH_PACKAGES_NUGET_APIKEY: ${{ secrets.GH_PACKAGES_NUGET_APIKEY }}
4758
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
48-
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
59+
NUGET_APIKEY: ${{steps.login.outputs.NUGET_API_KEY}}
4960
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5061
with:
5162
cake-version: tool-manifest

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.306"
3+
"rollForward": "latestFeature",
4+
"version": "10.0.100-rc.2.25502.107"
45
}
56
}

src/DPI/Commands/NuGet/NuGetAnalyzeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class NuGetAnalyzeCommand<TSettings> : NuGetCommand<TSettings> where TSet
2323

2424
private NuGetParsers NuGetParsers { get; }
2525

26-
public override async Task<int> ExecuteAsync(CommandContext context, TSettings settings)
26+
public override async Task<int> ExecuteAsync(CommandContext context, TSettings settings, CancellationToken cancellationToken)
2727
{
2828
FilePathCollection filePaths;
2929
using (settings.Logger.BeginScope("GetFiles"))

src/DPI/DPI.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-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
66
<Nullable>enable</Nullable>
77
<PackageIcon>icon/dpi.png</PackageIcon>
88
<ImplicitUsings>enable</ImplicitUsings>

0 commit comments

Comments
 (0)