Skip to content

Commit 49e4a8d

Browse files
feat(actions): add nuget trusted publishing
1 parent d9f1d87 commit 49e4a8d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
permissions:
1919
actions: read
2020
contents: write
21-
id-token: write # Required for Azure CLI Login
21+
id-token: write # Required for Azure / NuGet CLI Login
2222
steps:
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2424

@@ -115,8 +115,15 @@ jobs:
115115
gh release -R ${{ github.repository }} upload "${{ github.ref_name }}" $_.FullName
116116
}
117117
118+
- name: 🚀 NuGet login for push
119+
uses: NuGet/login@v1
120+
id: nuget-login
121+
with:
122+
user: ${{ secrets.NUGET_USER }}
123+
if: ${{ env.NUGET_API_KEY_DEFINED == 'true' }}
124+
118125
- name: 🚀 Push NuGet packages
119-
run: dotnet nuget push ${{ runner.temp }}\deployables\*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ secrets.NUGET_API_KEY }}'
126+
run: dotnet nuget push ${{ runner.temp }}\deployables\*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ steps.nuget-login.outputs.NUGET_API_KEY }}'
120127
if: ${{ env.NUGET_API_KEY_DEFINED == 'true' }}
121128

122129
- name: 🚀 Push NPM packages

0 commit comments

Comments
 (0)