Skip to content

feat(ci): trunk-based migration — main as the only long-lived branch#10

Merged
ChrisonSimtian merged 3 commits into
chore/ci-purge-non-githubfrom
feat/trunk-migration
May 18, 2026
Merged

feat(ci): trunk-based migration — main as the only long-lived branch#10
ChrisonSimtian merged 3 commits into
chore/ci-purge-non-githubfrom
feat/trunk-migration

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Summary

Replaces GitFlow (`develop` / `release/` / `master` / `hotfix/`) with trunk-based: a single `main` branch, short-lived feature/bugfix/chore branches off main, every merge can publish a release.

Stacked on top of #9 (CI purge). Change the base back to `develop` once #9 is merged. The non-Build.cs diff against current develop will look smaller after that.

Refs #7 (CI roadmap).

What's in this PR

Build code

  • Drop `MasterBranch` / `DevelopBranch` / `ReleaseBranchPrefix` / `HotfixBranchPrefix` constants. Replace with `MainBranch = "main"`.
  • Update `IsPublicRelease` and `IPublish.Publish.Requires` to check `IsOnMainBranch` instead of master/release/develop.
  • Absorb `MajorMinorPatchVersion` + `MilestoneTitle` + `Major` parameter into `Build.cs` from the deleted `Build.GitFlow.cs`.
  • `Build.CodeGeneration.cs`, `Build.Announce.cs`: master → main references.
  • `Build.GitFlow.cs` deleted entirely. Contained Milestone/Changelog/Release/Hotfix targets that were entirely GitFlow-specific.
  • `Build.CI.GitHubActions.cs`: branch filters main-ified, `OnPullRequestExcludePaths` added for docs/images/markdown. Alpha-deployment workflow attribute removed; `AlphaDeployment` constant retained with a comment because several code paths (Test.OnlyWhen, Pack.PackSettings, Publish.Requires, DeletePackages) still reference it.

Workflows

  • `ubuntu/windows/macos-latest.yml` — regenerated to match attributes. `branches-ignore: [main]` for push, `branches: [main]` + `paths-ignore` for pull_request.
  • `alpha-deployment.yml` — removed. The real release workflow lands in the next PR.

Docs

  • `CLAUDE.md` — branching section rewritten for trunk-based.

Cutover ceremony (manual, after merging this PR)

  1. Merge in-flight PRs against develop first (so their CI runs cleanly on the old workflow filters).
  2. Merge this PR into develop (chore(ci): drop non-GitHub CI providers #9 should be merged first to keep the diff focused).
  3. Rename `develop` → `main` on GitHub. Auto-retargets remaining open PRs.
  4. Set `main` as default branch (automatic with the rename).

Between steps 2 and 3 no CI triggers for new PRs because the workflows on develop now point at main. Keep the gap short — do the rename immediately after the merge.

Known follow-up (next PR)

  • Add Nerdbank.GitVersioning (`version.json` + package install).
  • Add a real release workflow on push-to-main → Publish to nuget.org.
  • Configure the `NUGET_API_KEY` repo secret.
  • Remove the `AlphaDeployment` constant + its dead code paths.
  • Eventually remove GitVersion entirely.

Test plan

  • `dotnet build build/_build.csproj` — 0 errors
  • No stale references to `MasterBranch` / `DevelopBranch` / `ReleaseBranchPrefix` / `HotfixBranchPrefix` / `IsOnMasterBranch` / `IsOnDevelopBranch` / `IsOnReleaseBranch` / `IsOnHotfixBranch`
  • Validation workflows trigger on this PR (will see when CI runs)
  • `paths-ignore` correctly skips docs-only PRs (verify on the next docs PR)

🤖 Generated with Claude Code

Replaces the GitFlow branch model (develop/release/*/master/hotfix/*)
with trunk-based — single `main` branch, short-lived feature/bugfix/
chore branches off main, every merge can publish a release.

Build code:
- Build.cs: drop MasterBranch/DevelopBranch/ReleaseBranchPrefix/
  HotfixBranchPrefix constants, replace with MainBranch = "main".
  Update IsPublicRelease and IPublish.Publish.Requires logic to check
  IsOnMainBranch instead of master/release/develop.
- Build.cs: absorb MajorMinorPatchVersion + MilestoneTitle + Major
  parameter from the deleted Build.GitFlow.cs.
- Build.CodeGeneration.cs, Build.Announce.cs: master → main references.
- Build.GitFlow.cs: DELETED. Contained Milestone/Changelog/Release/
  Hotfix targets that were entirely GitFlow-specific.
- Build.CI.GitHubActions.cs: branch filters main-ified, paths-ignore
  added for docs/images/markdown. Alpha-deployment workflow attribute
  removed; AlphaDeployment constant retained with a comment because
  several code paths (Test.OnlyWhen, Pack.PackSettings, Publish.Requires,
  DeletePackages) still reference it — they evaluate to false until the
  follow-up Nerdbank/release PR brings a workflow back under a new name.

Workflows:
- ubuntu/windows/macos-latest.yml: regenerated to match attributes.
  `branches-ignore: [main]` for push, `branches: [main]` + paths-ignore
  for pull_request.
- alpha-deployment.yml: removed.

Docs:
- CLAUDE.md: updated branching section to describe trunk-based.

Sequencing note: the default branch on GitHub (develop) has NOT been
renamed yet. Recommended ceremony:
  1. Merge any in-flight PRs against develop (so their CI runs cleanly)
  2. Merge this PR into develop
  3. Rename develop → main on GitHub (auto-retargets remaining PRs)
  4. Set main as default branch (automatic with the rename)

Between steps 2 and 3 no CI will trigger for new PRs, because the
workflows on develop now point at main. Keep the gap short.

Public release publishing is currently inert (no workflow invokes
Publish). The next PR adds Nerdbank.GitVersioning and a real release
workflow.

Refs #7

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removes the JetBrains Qodana static-analysis workflow and its
artifacts. It has been failing on every run on this fork because the
QODANA_TOKEN secret belonged to the previous maintainer's account.

Files removed:
- .github/workflows/code-quality.yml — the JetBrains/qodana-action job
- qodana.yml — local Qodana config
- qodana.sarif.json — 6.9MB baseline of suppressed findings from the
  previous maintainer's scans

The security-scanning gap will be filled by CodeQL — see
#8.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian mentioned this pull request May 18, 2026
2 tasks
@ChrisonSimtian ChrisonSimtian merged this pull request into chore/ci-purge-non-github May 18, 2026
3 checks passed
ChrisonSimtian added a commit that referenced this pull request May 18, 2026
@ChrisonSimtian ChrisonSimtian deleted the feat/trunk-migration branch May 18, 2026 04:02
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