Skip to content

Building Testing and Releasing

Stuart Meeks edited this page Jun 8, 2026 · 1 revision

Building, Testing and Releasing

For contributors. See also CONTRIBUTING.md and Architecture.

Prerequisites

  • .NET 10 SDK (dotnet --list-sdks should show a 10.0.x).
  • Windows 11 to build and run the WinUI 3 head (Snipdeck.App). Snipdeck.Core, Snipdeck.Execution and their tests are pure net10.0 and build/run on any platform.

Build and test

# Restore + build everything
dotnet build

# Core only (works on Linux / macOS)
dotnet build src/Snipdeck.Core

# Run the unit tests (cross-platform)
dotnet test tests/Snipdeck.Core.Tests
dotnet test tests/Snipdeck.Execution.Tests

On a non-Windows machine, restoring Snipdeck.App needs EnableWindowsTargeting=true:

EnableWindowsTargeting=true dotnet restore

You cannot build the App project off Windows — the XAML compiler is a Windows-only binary. CI builds Core on Ubuntu and the full solution on Windows.

Non-negotiables (they fail the build, not warn)

  • TreatWarningsAsErrors=true — every compiler, analyser and IDE-style violation is a build error. Fix the cause; suppress only narrowly with a comment.
  • .editorconfig at the repo root governs brace style, using ordering, naming (private fields are _camelCase) and analyser severities. dotnet format is your friend.
  • Curly braces always, even single-line bodies.
  • British English in user-facing copy, docs and comments (code identifiers follow .NET's American API conventions).
  • Enterprise-professional tone; no emojis in UI strings.

Versioning

The version is owned by Nerdbank.GitVersioning (NBGV), not the tag you type. version.json at the repo root holds the base version; NBGV derives the full version from it plus git height and stamps every assembly, and the release workflow reads it back. So bump version.json to change the version line.

Releasing

Releases are driven by git tags from main and run on Windows CI. Create the tag with NBGV so its name matches the computed version:

git checkout main && git pull
nbgv tag            # mints e.g. v1.0.0 from version.json
git push origin v1.0.0

Pushing a matching tag triggers .github/workflows/release.yml, which: asserts a public release (per publicReleaseRefSpec), runs the Core tests, publishes Snipdeck.App (win-x64, self-contained), packs it with Velopack, and attaches the artefacts (Snipdeck-stable-Setup.exe, the portable zip, and the update feed) to a new GitHub Release. A hyphen in the version (-alpha, -beta) marks it a pre-release and feeds Velopack's channel.

To cut a new line, edit version.json first (e.g. 0.2.01.0.0), commit on main, then nbgv tag and push. Don't tag from feature branches.

Conventions for changes

  • One logical change per commit; the body explains why.
  • Every user-visible change gets a line under ## [Unreleased] in CHANGELOG.md (Keep-a-Changelog format), and README.md stays in sync with what ships today.
  • Tests use xUnit; cover the substitution engine, the JSON store and the VT processor heavily.

Clone this wiki locally