Move package publishing from MyGet to NuGet trusted publishing - #3213
Merged
Conversation
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.
This was referenced Sep 10, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.release.yml: triggered by a published GitHub Release (plusworkflow_dispatchfor 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).appveyor.ymloutright: it was independently deploying to MyGet on every push tomain, so leaving it would have kept MyGet pushes alive regardless of the GitHub Actions changes.README.mdanddocs/ReleaseNotes.md.Refs #3184.
Test plan
workflow_dispatchdry run of release.yml completes through pack/upload-artifact without attempting a pushrelease.yml/environmentrelease) is confirmed in place before the first real release