Skip to content

Commit 4cb2557

Browse files
authored
Use NuGet Trusted Publishing
1 parent 0061f92 commit 4cb2557

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI
22

33
on: [ push, pull_request ]
44

5+
permissions:
6+
id-token: write
7+
58
jobs:
69
ci:
710

@@ -22,8 +25,14 @@ jobs:
2225
- name: Test
2326
run: dotnet test -c Release -maxCpuCount -- Expecto.fail-on-focused-tests=true
2427

28+
- name: NuGet login
29+
uses: NuGet/login@v1
30+
id: nuget_login
31+
with:
32+
user: ${{ secrets.NUGET_USER }}
33+
2534
- name: Push
2635
if: startsWith(github.ref, 'refs/tags/v/')
2736
env:
2837
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
29-
run: dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate
38+
run: dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k ${{ steps.nuget_login.outputs.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)