Skip to content

Commit 1e78559

Browse files
committed
Using trusted publishing for nuget
1 parent e2dc9c5 commit 1e78559

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ jobs:
99
publish:
1010
name: 📦 Publish nuget library
1111
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
1214
steps:
1315
- name: 📦 Download Artifact
1416
run: gh release download ${{ github.ref_name }} --repo ${{ github.repository }} --pattern '*.nupkg'
1517
env:
1618
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1719

20+
- name: 🔐 NuGet login
21+
uses: NuGet/login@v1
22+
id: login
23+
with:
24+
user: ${{ secrets.NUGET_USER }}
25+
1826
- name: ✈️ Push Nuget
19-
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
27+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)