Skip to content

Move package publishing from MyGet to NuGet trusted publishing - #3213

Merged
mgravell merged 1 commit into
mainfrom
marc/nuget-trusted-publishing
Sep 10, 2026
Merged

Move package publishing from MyGet to NuGet trusted publishing#3213
mgravell merged 1 commit into
mainfrom
marc/nuget-trusted-publishing

Conversation

@mgravell

Copy link
Copy Markdown
Collaborator

Summary

  • MyGet is refusing our pushes, so drop it rather than fight it.
  • CI.yml: remove the pack/push-to-MyGet steps from the Windows job; add an early step that surfaces the nbgv-computed version in the step summary, so a release tag can be read straight off a passing CI run.
  • New release.yml: triggered by a published GitHub Release (plus workflow_dispatch for dry runs). Verifies the release tag against nbgv, then builds, packs, and pushes to nuget.org via Trusted Publishing (OIDC) - no long-lived API key. Deliberately skips tests (the released commit already passed CI) and runs on Linux (net461/net472 build fine against reference assemblies without a Windows runtime).
  • Drop appveyor.yml outright: it was independently deploying to MyGet on every push to main, so leaving it would have kept MyGet pushes alive regardless of the GitHub Actions changes.
  • Strip the MyGet feed/badge from README.md and docs/ReleaseNotes.md.

Refs #3184.

Test plan

  • CI.yml Windows job runs green and the step summary shows the computed version
  • workflow_dispatch dry run of release.yml completes through pack/upload-artifact without attempting a push
  • Trusted Publishing policy on nuget.org (owner/repo/release.yml/environment release) is confirmed in place before the first real release
  • Cut a real release with the tag read off a CI run and confirm the package lands on nuget.org

MyGet stopped accepting our pushes, so drop it entirely rather than fight it: CI now
just builds/tests and surfaces the nbgv-computed version so a release tag can be cut
from it, and a new release.yml (triggered by a published GitHub Release) verifies the
tag against nbgv, then packs and pushes to nuget.org via OIDC trusted publishing. Also
removes appveyor.yml, which was independently deploying to MyGet on every main push.
@mgravell
mgravell merged commit e621b46 into main Sep 10, 2026
6 of 7 checks passed
@mgravell
mgravell deleted the marc/nuget-trusted-publishing branch September 10, 2026 09:12
mgravell added a commit that referenced this pull request Sep 10, 2026
…ble (#3217)

The 3.2.0 release failed its "Verify tag matches computed version" guard with
"Tag '3.2.0' does not match the computed version '3.2.0-g8460293104'".

Cause: publicReleaseRefSpec still carried the v2-era "^refs/tags/v\d+\.\d+".
The whole v3 line tags without the "v" (3.0.0 ... 3.1.31, 3.2.0), so on a
release event - where GITHUB_REF is refs/tags/3.2.0 - nbgv did not consider the
build a public release and appended the "-g<commit>" suffix. This never bit us
before because release.yml is new (#3213); every earlier v3 package was pushed
from a main build, where the refspec did match. The stray 3.1.1-g7441909d06 on
nuget.org is the same failure mode escaping under the old pipeline.

Relax the refspec to "^refs/tags/v?\d+\.\d+" so both spellings are public.

Because this commit adds to the commit height, drop versionHeightOffset to -3
so the release commit still computes as 3.2.0 rather than skipping to 3.2.1.
versionHeightOffsetAppliesTo is already "3.2", so the height is not reset.

Verified with nbgv on this commit: refs/tags/3.2.0, refs/tags/v3.2.0 and
refs/heads/main all compute NuGetPackageVersion 3.2.0.
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.

1 participant