Skip to content

feat(release): Nerdbank.GitVersioning + GitHub Actions release pipeline#20

Merged
ChrisonSimtian merged 3 commits into
mainfrom
feat/nerdbank-and-release
May 18, 2026
Merged

feat(release): Nerdbank.GitVersioning + GitHub Actions release pipeline#20
ChrisonSimtian merged 3 commits into
mainfrom
feat/nerdbank-and-release

Conversation

@ChrisonSimtian

@ChrisonSimtian ChrisonSimtian commented May 18, 2026

Copy link
Copy Markdown
Collaborator

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

  • `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 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

  • Drop `FeedzNuGetSource` / `FeedzNuGetApiKey` / `IsPublicRelease` — no alpha feed in trunk-based.
  • Rename `PublicNuGetApiKey` → `NuGetApiKey`.
  • `IPublish.NuGetSource` now derives from `GITHUB_REPOSITORY_OWNER` (with `ChrisonSimtian` local fallback) → GitHub Packages URL.
  • `Pack.SetVersion(9999.0.0)` only applies for `Terminal` (local) builds; CI lets Nerdbank's MSBuild version stand.
  • `Test.OnlyWhenStatic` guard removed (was excluding alpha-deployment).
  • `DeletePackages` now only handles the Terminal case (cleans local 9999.0.0 packages).
  • `Build.SignPackages.cs` `IsPublicRelease` → `IsOnMainBranch`.

Workflow constant

`Build.CI.GitHubActions.cs` — `AlphaDeployment` → `ReleaseWorkflow`. `Publish.Requires` now checks `Workflow == ReleaseWorkflow`.

Versioning expectations

Once merged:

Ref Output version
`main` (first commit after this) `10.2.` — stable, published to GitHub Packages
Any feature branch `10.2.-.+` — prerelease
Tag `v10.2.0` `10.2.0` exactly

Minor bumps (10.2 → 10.3): edit `version.json` or run `nbgv prepare-release`.

Test plan

  • `dotnet restore nuke-common.slnx` — Nerdbank.GitVersioning 3.7.115 resolves on all 26 projects
  • `dotnet build build/_build.csproj` — 0 errors after edits (warnings dropped from 59 → 9 thanks to chore(deps): patch vulnerable transitives (CVE-2026-33116, Scriban) #4 already on main)
  • Validation workflow (ubuntu-latest) green on this PR
  • After merge: `release.yml` triggers, Test+Pack succeed, Publish hits GitHub Packages successfully (no manual secret setup needed)

Follow-ups (separate PRs, not blocking this)

  • Fully remove GitVersion (replace `MajorMinorPatchVersion` with Nerdbank-derived equivalent)
  • Decide fate of `Build.Announce.cs` (orphaned since AppVeyor drop)
  • Switch publish target to nuget.org after the project rename happens

🤖 Generated with Claude Code

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>
ChrisonSimtian and others added 2 commits May 18, 2026 19:42
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>
@ChrisonSimtian
ChrisonSimtian merged commit 498c629 into main May 18, 2026
2 checks passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/nerdbank-and-release branch May 18, 2026 07:45
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