Skip to content

Commit e2ef4a9

Browse files
authored
Update nuget publishing to use trusted publishing
1 parent db6f4c3 commit e2ef4a9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/publish_winuiex_nuget.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@ jobs:
3636
with:
3737
name: NuGet Packages
3838
path: artifacts/NuGet/Release
39-
39+
40+
# Get a short-lived NuGet API key
41+
- name: NuGet login (OIDC → temp API key)
42+
uses: NuGet/login@v1
43+
id: login
44+
with:
45+
user: ${{ secrets.NUGET_USER }}
46+
4047
- name: Push to NuGet
4148
run: |
42-
dotnet nuget push artifacts\NuGet\Release\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org
43-
dotnet nuget push artifacts\NuGet\Release\*.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org
49+
dotnet nuget push artifacts\NuGet\Release\*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
50+
dotnet nuget push artifacts\NuGet\Release\*.snupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)