Skip to content

Commit 9fdcb16

Browse files
committed
ci: use trusted publishing
1 parent 390c8a1 commit 9fdcb16

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
permissions:
2424
packages: write
2525
contents: write
26+
id-token: write
2627

2728
steps:
2829
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -49,6 +50,13 @@ jobs:
4950
name: packages
5051
path: bin/*.nupkg
5152

53+
# Get a short-lived NuGet API key
54+
- name: NuGet login (OIDC → temp API key)
55+
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0
56+
id: login
57+
with:
58+
user: ${{ secrets.NUGET_USER }}
59+
5260
- name: deploy github.com
5361
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
5462
shell: bash
@@ -61,7 +69,7 @@ jobs:
6169
shell: bash
6270
env:
6371
NUGET_SOURCE: https://api.nuget.org/v3/index.json
64-
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
72+
NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
6573

6674
gh-release:
6775
needs:

0 commit comments

Comments
 (0)