Skip to content

Commit 566dfa3

Browse files
committed
Use Trusted Publishing for NuGet
1 parent 5b99781 commit 566dfa3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/CI.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,17 @@ jobs:
6161
--api-key ${{ secrets.GITHUB_TOKEN }} \
6262
--skip-duplicate
6363
64+
- name: NuGet login
65+
uses: NuGet/login@v1
66+
id: login
67+
if: startsWith(github.ref, 'refs/tags/v')
68+
with:
69+
user: ${{ secrets.NUGET_USER }}
70+
6471
- name: Publish to NuGet
6572
if: startsWith(github.ref, 'refs/tags/v')
6673
run: |
6774
dotnet nuget push ./nupkg/*.nupkg \
6875
--source https://api.nuget.org/v3/index.json \
69-
--api-key ${{ secrets.NUGET_API_KEY }} \
76+
--api-key ${{ steps.login.outputs.NUGET_API_KEY }} \
7077
--skip-duplicate

0 commit comments

Comments
 (0)