Terminal.Gui/README.md
This directory contains the core Terminal.Gui library source code. This README documents how to maintain and release the library. For contribution guidelines, see CONTRIBUTING.md. For building apps with Terminal.Gui, see the documentation.
Versions are computed automatically by GitVersion 6.x using the GitFlow branching strategy. Configuration is in GitVersion.yml.
The GitVersion.MsBuild NuGet package is included in Terminal.Gui.csproj and automatically sets Version, AssemblyVersion, FileVersion, and InformationalVersion from git history at build time. No manual version management is needed.
| Branch | Example Version | Increment | Notes |
|---|---|---|---|
main (stable) | 2.0.0 | Patch | Label set in GitVersion.yml (label: '') |
main (pre-release) | 2.0.1-rc.1 | Patch | Label set in GitVersion.yml (e.g., label: rc) |
develop | 2.1.0-develop.42 | Minor | Always carries -develop pre-release label |
feature/*, fix/*, etc. | 2.1.0-my-feature.1 | Inherit | Inherits from develop; branch name becomes label |
pull-request/* | 2.0.0-pr.123.1 | Inherit | PR number in label |
# Install the CLI tool (one-time)
dotnet tool install --global GitVersion.Tool
# Show what version would be computed for the current branch
dotnet-gitversion
The version is also embedded in every build. For example, UICatalog --version displays the terse SemVer (build metadata after + is stripped).
mainTo change the pre-release stage, edit the label field under main in GitVersion.yml:
| Stage | label value | Example Output |
|---|---|---|
| Beta | beta | 2.0.0-beta.1 |
| Release Candidate | rc | 2.0.0-rc.1 |
| Stable Release | '' (empty) | 2.0.0 |
Releases follow Semantic Versioning: MAJOR for breaking changes, MINOR for new features, PATCH for bug fixes.
Two workflows handle the release lifecycle:
Step 1 — Prepare Release (manual trigger):
beta, rc, stable) and optionally override the version.release/vX.Y.Z branch from develop, updates the GitVersion.yml label, and opens a PR into main.Step 2 — Finalize Release (automatic on PR merge):
When the release PR is merged into main:
vX.Y.Z or vX.Y.Z-beta)main → develop) to keep branches in syncIf you need to release manually:
Ensure develop is ready: all changes committed, CI passing.
Merge develop into main:
git checkout main
git pull upstream main
git checkout develop
git pull upstream develop
git checkout main
git merge develop
# Fix any merge conflicts
Update the pre-release label in GitVersion.yml if changing stages (e.g., beta → rc → '').
Tag the release on main:
git tag vX.Y.Z -a -m "Release vX.Y.Z"
Push atomically:
git push --atomic upstream main vX.Y.Z
Monitor CI: the Publish workflow builds and pushes to NuGet. It also triggers an update to Terminal.Gui.templates for stable releases.
Create a GitHub Release at Releases with auto-generated release notes.
Merge main back into develop:
git checkout develop
git pull upstream develop
git merge main
git push upstream develop
All workflows are in .github/workflows/:
| Workflow | Trigger | Purpose |
|---|---|---|
| prepare-release.yml | Manual dispatch | Creates a release PR from develop → main with label updates |
| finalize-release.yml | Release PR merged to main | Creates tag, GitHub Release, back-merge PR to develop |
| publish.yml | Push to main or develop, version tags | Builds Release config, packs, and publishes to NuGet.org |
| release.yml | Manual dispatch | (Legacy) Direct tag-and-release on main; superseded by prepare/finalize |
| build-validation.yml | Push/PR to main or develop | Builds all configurations to validate compilation |
| unit-tests.yml | Push/PR to main or develop | Runs all unit tests |
| api-docs.yml | Push to develop | Builds and deploys API docs to GitHub Pages |
| codeql-analysis.yml | Push/PR to main or develop | CodeQL security analysis |
| integration-tests.yml | Push/PR to main or develop | Integration tests |
| stress-tests.yml | Push/PR to main or develop | Stress tests |
Terminal.Gui V1 (latest: v1.19.0) is maintained on separate branches:
| Branch | Purpose |
|---|---|
v1_release | V1 stable releases (equivalent of main for V1) |
v1_develop | V1 development (equivalent of develop for V1) |
V1 follows the same GitFlow model as V2 but is in maintenance-only mode. The V1 NuGet package is Terminal.Gui 1.x. V1 API docs are published from v1_release to a separate GitHub Pages path.
These branches are not configured in GitVersion.yml (the config was removed to avoid interference with V2 versioning). V1 releases are tagged manually (e.g., v1.19.0).
main or develop (pre-release versions from develop, stable versions from main)2.1.0-develop.42) are marked as pre-release on NuGetWhen building in Release configuration, the .csproj automatically:
.nupkg and .snupkg to ../local_packages/Use the local_packages folder as a local NuGet source to test packages before publishing:
dotnet build Terminal.Gui/Terminal.Gui.csproj -c Release
# Package is now in local_packages/ and your global NuGet cache
docfx/ — see docfx/README.md for local generationmainSee CONTRIBUTING.md for build/test instructions, coding conventions, and PR guidelines.