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
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
defaults:
run:
working-directory: Src
permissions:
id-token: write # enable GitHub OIDC token issuance for this job

steps:
- name: Checkout
Expand Down Expand Up @@ -135,11 +137,18 @@ jobs:
artifacts/*.nupkg
artifacts/*.snupkg
retention-days: 30

# Get a short-lived NuGet API key
- name: NuGet login (OIDC -> temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}

- name: Publish to NuGet
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
shell: pwsh
run: |
Get-ChildItem "${{ github.workspace }}\artifacts\*.nupkg" | ForEach-Object {
dotnet nuget push $_.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push $_.FullName --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
}