feat(release): Nerdbank.GitVersioning + GitHub Actions release pipeline#20
Merged
Conversation
Versioning moves from GitFlow-driven GitVersion to trunk-based Nerdbank.GitVersioning. Adds the missing release pipeline so merges to main can publish to nuget.org. Versioning - version.json — Nerdbank config. version "10.2", publicReleaseRefSpec scoped to main (stable versions only on main, prereleases elsewhere), semVer 2 nuget output, assembly version pinned to major.minor for binding stability. - Directory.Packages.props — Nerdbank.GitVersioning 3.7.115. - source/Directory.Build.props — PackageReference with PrivateAssets="All" so the package isn't a transitive dep of consumers. - GitVersion still installed for the moment because Build.cs's MajorMinorPatchVersion property still reads from it; that's a follow-up cleanup. Release pipeline - .github/workflows/release.yml — hand-written (not auto-generated). Triggered on push to main, fetch-depth: 0 for Nerdbank, runs Test + Pack + Publish via ./build.cmd. Reads NUGET_API_KEY secret (must be added to repo secrets before the first release fires). - Why hand-written: lets us name the GitHub secret NUGET_API_KEY (conventional screaming-snake-case) while keeping the NUKE parameter NuGetApiKey (idiomatic C#). The [GitHubActions] attribute generator would force the two to share a name. Build.cs simplification - Drop FeedzNuGetSource / FeedzNuGetApiKey / IsPublicRelease (no alpha feed in trunk-based; main is the only release target). - Rename PublicNuGetApiKey → NuGetApiKey. - IPublish.NuGetSource / NuGetApiKey now unconditional. - Pack.SetVersion(9999.0.0) only applies for Terminal (local) builds; CI lets Nerdbank's MSBuild-injected version stand. - Test.OnlyWhenStatic guard removed (was excluding alpha-deployment). - DeletePackages now only handles the Terminal case. Workflow constant - Build.CI.GitHubActions.cs — AlphaDeployment → ReleaseWorkflow. - Publish.Requires now checks Workflow == ReleaseWorkflow. Docs - CLAUDE.md — versioning + release-pipeline sections rewritten. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per Matt's wish that the "Nuke" name not be carried over, the successor project needs a new name before publishing to nuget.org. Until that lands, release publishing targets GitHub Packages on this fork — gives us a real release pipeline without claiming the upstream identity. - Build.cs IPublish.NuGetSource → GitHub Packages URL derived from GITHUB_REPOSITORY_OWNER (with ChrisonSimtian fallback for local). - release.yml uses secrets.GITHUB_TOKEN (auto-provided, packages:write already granted) instead of a separate NUGET_API_KEY. - CLAUDE.md updated: dropped stale Feedz/AppVeyor paragraph that slipped through the trunk-migration edit; added GitHub Packages rationale + name-change context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Versioning moves from GitFlow-driven GitVersion to trunk-based Nerdbank.GitVersioning. Adds the missing release pipeline so merges to `main` can publish — to GitHub Packages on this fork, not nuget.org. (See "Why GitHub Packages" below.)
Versioning
GitVersion is still installed (transitionally) because Build.cs's `MajorMinorPatchVersion` reads from it for the GitHub release name + milestone title. Full GitVersion removal is a follow-up.
Why GitHub Packages, not nuget.org
Per Matt's wish, the "Nuke" name cannot be carried over to a successor project. Publishing to nuget.org would require a new name we don't have yet. Until the hard-fork rename ceremony happens, the release pipeline publishes to GitHub Packages on this fork (`https://nuget.pkg.github.com/ChrisonSimtian/index.json\`).
Switching the target back to nuget.org becomes a one-line follow-up once we have a name.
Release pipeline
`.github/workflows/release.yml` — hand-written, not auto-generated. Triggered on push to main, fetch-depth 0 (Nerdbank), runs `./build.cmd Test Pack Publish`.
Auth
Uses the auto-provided `GITHUB_TOKEN` (the workflow already declares `permissions: packages: write`). No separate NuGet API key needed. When we eventually point publishing at nuget.org, that's when we'll add a `NUGET_API_KEY` secret.
Why hand-written
The NUKE `[GitHubActions]` attribute generator would force the GitHub secret name to match the NUKE parameter name. Hand-writing the workflow lets the C# parameter stay idiomatic (`NuGetApiKey`) while the workflow uses `GITHUB_TOKEN` directly.
Build.cs simplification
Workflow constant
`Build.CI.GitHubActions.cs` — `AlphaDeployment` → `ReleaseWorkflow`. `Publish.Requires` now checks `Workflow == ReleaseWorkflow`.
Versioning expectations
Once merged:
Minor bumps (10.2 → 10.3): edit `version.json` or run `nbgv prepare-release`.
Test plan
Follow-ups (separate PRs, not blocking this)
🤖 Generated with Claude Code