Skip to content

Switch NuGet publishing to OIDC trusted publishing#213

Merged
jfversluis merged 1 commit into
mainfrom
fix/nuget-trusted-publishing
May 12, 2026
Merged

Switch NuGet publishing to OIDC trusted publishing#213
jfversluis merged 1 commit into
mainfrom
fix/nuget-trusted-publishing

Conversation

@jfversluis

Copy link
Copy Markdown
Owner

Replaces the secret-based NUGET_API_KEY approach with NuGet's OIDC trusted publishing via nuget/login@v1.

Changes:

  • Uses nuget/login@v1 for OIDC-based authentication (no API key secret needed)
  • Adds id-token: write permission for OIDC
  • Adds workflow_dispatch trigger for manual releases with version input
  • Uploads .nupkg as build artifact
  • Removes the Verify commit exists in origin/main step (tag-based triggers already ensure this)
  • Uses --skip-duplicate for idempotent pushes

Prerequisites: The NuGet.org trusted publisher must be configured for this repository at https://www.nuget.org/packages/Plugin.Maui.Audio/manage

Replace secret-based NUGET_API_KEY with nuget/login OIDC flow.
Also adds workflow_dispatch trigger for manual releases and
uploads build artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 08:40
@jfversluis jfversluis merged commit 1e47b13 into main May 12, 2026
4 checks passed
@jfversluis jfversluis deleted the fix/nuget-trusted-publishing branch May 12, 2026 08:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the NuGet release workflow to publish Plugin.Maui.Audio packages using NuGet.org OIDC trusted publishing (via nuget/login@v1) instead of a long-lived API key secret.

Changes:

  • Adds workflow_dispatch support with a manual version input for releases.
  • Switches authentication to NuGet OIDC (nuget/login@v1) and pushes with --skip-duplicate.
  • Uploads generated .nupkg files as a workflow artifact.

Comment on lines +11 to +12
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9]+"

permissions:
contents: read
packages: write
"version-without-v=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
$tagOrInput = "${{ inputs.version != '' && inputs.version || github.ref_name }}"
$version = $tagOrInput.TrimStart("v")
dotnet pack src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj -c Release -p:PackageVersion=$version -o artifacts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants