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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
# nuget.org Trusted Publishing: the job's OIDC token is exchanged for a
# short-lived API key, so no long-lived key is stored in the repo.
permissions:
id-token: write
steps:
- uses: actions/setup-dotnet@v4
with:
Expand All @@ -62,5 +66,12 @@ jobs:
name: nupkg
path: ./artifacts

# user: the nuget.org profile that owns the Trusted Publishing policy (not a secret).
- name: NuGet login (OIDC to a temporary API key)
id: nuget-login
uses: NuGet/login@v1
with:
user: michaelTBF

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