Skip to content

Commit 2c1b281

Browse files
committed
Use NuGet trusted publishing in publishing workflows
1 parent f074e7d commit 2c1b281

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎.github/workflows/publish-package.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
workflow_dispatch:
1414

1515
permissions:
16+
id-token: write
1617
contents: write
1718
packages: write
1819

@@ -75,6 +76,12 @@ jobs:
7576
--no-restore \
7677
--output ./artifacts
7778
79+
- name: Log in to NuGet
80+
uses: NuGet/login@v1
81+
id: nuget-login
82+
with:
83+
user: soenneker
84+
7885
- name: Publish to NuGet
7986
shell: bash
8087
run: |
@@ -86,7 +93,7 @@ jobs:
8693
set +e
8794
dotnet nuget push ./artifacts/*.nupkg \
8895
--source "https://api.nuget.org/v3/index.json" \
89-
--api-key "${{ secrets.NUGET__TOKEN }}" \
96+
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \
9097
--skip-duplicate 2>&1 | tee "$output_file"
9198
exit_code=${PIPESTATUS[0]}
9299
set -e

0 commit comments

Comments
 (0)