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
15 changes: 14 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # Required for dorny/test-reporter to create check runs
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -63,6 +66,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: [ build ]
permissions:
packages: write # Required to publish to GitHub Packages
id-token: write # Required for NuGet trusted publishing (OIDC)
Comment thread
corpo-iwillspeak marked this conversation as resolved.
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v8
Expand All @@ -81,7 +87,14 @@ jobs:
run: |
dotnet nuget push ${NuGetDirectory}/*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source "https://nuget.pkg.github.com/crispthinking/index.json" --skip-duplicate

- name: NuGet login (OIDC → temp API key)
if: github.event_name == 'release'
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}

- name: Publish NuGet package
if: github.event_name == 'release'
run: |
dotnet nuget push ${NuGetDirectory}/*.nupkg --api-key "${{ secrets.NUGET_APIKEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
dotnet nuget push ${NuGetDirectory}/*.nupkg --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate