Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
# Trusted Publishing: nuget.org exchanges the workflow's OIDC token for a short-lived API key, so the repository
# keeps no NuGet API key. Policy on nuget.org: owner kododo-dev, this repository, workflow publish-nuget.yml.
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -90,9 +95,15 @@ jobs:
-p:Version=${{ steps.version.outputs.VERSION }} \
--output ./nupkgs

- name: NuGet login (Trusted Publishing)
id: nuget-login
uses: NuGet/login@v1
with:
user: ${{ vars.NUGET_USER }}

- name: Push to NuGet
run: |
dotnet nuget push ./nupkgs/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
Loading