Skip to content

Commit 8c45762

Browse files
committed
C#: implement trusted publishing.
1 parent 9e92075 commit 8c45762

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/csharp-release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
name: C# Release
1010
runs-on: ubuntu-24.04
1111
environment: release
12+
permissions:
13+
id-token: write
1214

1315
steps:
1416
- uses: actions/checkout@v6
@@ -28,11 +30,17 @@ jobs:
2830
cd csharp
2931
dotnet build --configuration Release Svix --no-restore
3032
33+
- name: NuGet login
34+
uses: NuGet/login@v1
35+
id: login
36+
with:
37+
user: ${{ secrets.NUGET_USER }}
38+
3139
- name: Release
3240
run: |
3341
cd csharp
3442
dotnet nuget push "$(find Svix/bin/Release/Svix.*.nupkg)" \
3543
--api-key "$NUGET_API_KEY" \
3644
--source "https://api.nuget.org/v3/index.json"
3745
env:
38-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
46+
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}

0 commit comments

Comments
 (0)