Skip to content

Commit 7dc7868

Browse files
Update release pipeline for trusted publishing (#798)
1 parent 1948593 commit 7dc7868

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ 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

@@ -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)