Skip to content

Commit 6c4fe29

Browse files
Use Trusted Publishing (#252)
1 parent de88b88 commit 6c4fe29

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
- uses: actions/checkout@v5
2020

2121
- name: Setup .NET
22-
uses: actions/setup-dotnet@v4
22+
uses: actions/setup-dotnet@v5
2323
with:
2424
dotnet-version: |
2525
8.0.x
2626
9.0.x
2727
2828
- name: Setup .NET
29-
uses: actions/setup-dotnet@v4
29+
uses: actions/setup-dotnet@v5
3030
with:
3131
dotnet-quality: 'preview'
3232
dotnet-version: |

.github/workflows/release.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ on:
66
tags:
77
- '**'
88

9-
permissions:
10-
contents: write
11-
129
jobs:
1310
release:
11+
permissions:
12+
id-token: write # enable GitHub OIDC token issuance for this job
13+
contents: write # enable github releases
1414

1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- uses: actions/checkout@v5
1919

2020
- name: Setup .NET
21-
uses: actions/setup-dotnet@v4
21+
uses: actions/setup-dotnet@v5
2222
with:
2323
dotnet-version: |
2424
8.0.x
2525
9.0.x
2626
2727
- name: Setup .NET
28-
uses: actions/setup-dotnet@v4
28+
uses: actions/setup-dotnet@v5
2929
with:
3030
dotnet-quality: 'preview'
3131
dotnet-version: |
@@ -38,8 +38,15 @@ jobs:
3838

3939
- name: Package
4040
run: dotnet pack -c Release --no-build --property:PackageOutputPath=../../nupkgs
41+
42+
- name: NuGet login (OIDC → temp API key)
43+
uses: NuGet/login@v1
44+
id: login
45+
with:
46+
user: viceroypenguin
47+
4148
- name: Push to Nuget
42-
run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGETPUBLISHKEY }}
49+
run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ steps.login.outputs.NUGET_API_KEY }}
4350

4451
- name: Create Release
4552
uses: ncipollo/release-action@v1

0 commit comments

Comments
 (0)