README (badges from Gitea Actions and shields' Gitea release badge, "Where things live", downloads from releases.poli0981.dev, checksums and the CycloneDX SBOM instead of `gh attestation verify`, a note that 2.2.0 and older must update once by hand), USAGE, UPDATES (the HTTP feed, the file layout on R2, the delta from `vpk download s3`), RELEASING (the new release workflow, its dry run, user-level R2 secrets), BUILD (the CI table on Gitea Actions, Renovate), PRIVACY (the update check goes to releases.poli0981.dev through Cloudflare), SECURITY (e-mail only, never a public issue on the mirror; Qodana, gitleaks, Opengrep, osv-scanner, NuGetAudit, Renovate instead of CodeQL, Scorecard, SonarCloud, Snyk and Dependabot; no attestations), CONTRIBUTING (Gitea read-only, issues and merge requests on GitLab, patches by e-mail), CODE_OF_CONDUCT, EULA, DISCLAIMER and MAINTAINERS lose their GitHub references, THIRD-PARTY-NOTICES swaps SonarScanner for CycloneDX, Directory.Build.props points RepositoryUrl at Gitea, and CLAUDE.md gets the new rules 6 and 7 and a "Forge & CI" section. CHANGELOG entries stay as they were; only the compare links at the bottom point at Gitea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.2 KiB
Building CommandForge
Requirements
- Windows 10 (22H2) or Windows 11
- .NET 10 SDK — the feature band is pinned in
global.json(dotnet --version→10.0.4xx) - Admin rights are only needed to test elevated commands, not to build.
The solution file is CommandForge.slnx (the XML solution format).
| Project | Role |
|---|---|
src/CommandForge.Domain |
Entities; no dependencies |
src/CommandForge.Application |
Use cases and ports; depends only on Domain |
src/CommandForge.Infrastructure |
Processes, registry, catalog, storage, Velopack, logging |
src/CommandForge.Wpf |
The WPF app (WPF-UI); namespace CommandForge.Desktop |
helper/CommandForge.Elevator |
The elevated helper that runs admin commands over a named pipe |
tests/CommandForge.Tests |
xUnit v3 tests |
Build, run, test
dotnet restore CommandForge.slnx
dotnet build CommandForge.slnx -c Release # must be 0 warnings (warnings are errors)
dotnet run --project src/CommandForge.Wpf
dotnet test CommandForge.slnx
The tests use xUnit v3 in VSTest mode (xunit.v3.mtp-off), so dotnet test and the coverlet
collector work as usual.
Code style and analysis
dotnet format CommandForge.slnx # apply formatting
dotnet format CommandForge.slnx --verify-no-changes # CI gate
The build treats warnings as errors and enforces the .NET analyzers, code style
(EnforceCodeStyleInBuild) and SonarAnalyzer.CSharp (Sonar's C# rules as a Roslyn analyzer),
including unused-using and unused-member rules.
To measure test coverage (Coverlet, OpenCover format):
dotnet test CommandForge.slnx --collect "XPlat Code Coverage;Format=opencover"
Dependencies
- Package versions live in each
.csproj; SonarAnalyzer is referenced once fromDirectory.Build.props. Central Package Management is not used (a convention from the GitHub days, when the dependency graph didn't readDirectory.Packages.props; Renovate reads both). - Every restore runs a NuGet audit of direct and transitive packages; moderate or higher advisories fail the build.
- A self-hosted Renovate on Gitea (the shared preset
poli0981/renovate-config, plusrenovate.json) proposes updates: minor and patch ones grouped, each held for 3 days after release, security fixes at once. Velopack and thevpktool move together; majors wait for approval on the Dependency Dashboard, and new majors of the .NET SDK and ofMicrosoft.Extensions.*are never proposed: moving to a new .NET major is a deliberate migration, done by hand.
Publish (self-contained) + package
The Velopack CLI is pinned as a local tool in .config/dotnet-tools.json, at the same version as
the Velopack library:
dotnet tool restore
pwsh ./scripts/pack.ps1 -Version 2.0.0 # publish + vpk pack
pwsh ./scripts/pack.ps1 -Version 2.0.0 -SkipPack # publish only
pack.ps1 (parameters: -Version, -Runtime = win-x64, -Configuration = Release,
-SkipPack):
- runs a self-contained ReadyToRun publish, stamping the version so the in-app version matches the release;
- checks that
CommandForge.Elevatoris in the publish folder (thePublishElevatorOnPublishtarget insrc/CommandForge.Wpf/CommandForge.Wpf.csprojpublishes it alongside the app); - runs
vpk packwith--runtime, so the installer and updater helpers are native x64, and stops on any non-zero exit code.
It writes these artifacts to Releases/:
CommandForge-win-Setup.exe— the installerCommandForge-<version>-full.nupkg— full packageCommandForge-<version>-delta.nupkg— delta package (only when a previous full package is present; see UPDATES.md)releases.win.json/RELEASES— the update manifest read by the app
scripts/release-assets.ps1 -Version <X.Y.Z>, run after pack.ps1, adds what a release publishes
next to them: the CycloneDX SBOM, SHA256SUMS and the release notes, under r2-release/ (the
release workflow runs both; locally they are a dry run).
No Authenticode signing yet — see SECURITY.md. Don't add a signing step until Azure Trusted Signing (or SignPath Foundation for OSS) is set up.
CI
CI runs on Gitea Actions at git.poli0981.dev/poli0981/CommandForge, on the maintainer's
own runner: windows-latest jobs run in host mode on a Windows 11 PC, ubuntu-latest jobs in
Docker. The runner is online when the PC is on, so a run can wait; scheduled jobs only fall in
13:00–16:00 UTC. The shared workflows come from the ops repository poli0981/.github, pinned by
commit SHA (its migration runbook is docs/GITEA-MIGRATION.md there). All workflows pin actions
to full commit SHAs and use least-privilege permissions.
| Workflow | What it does |
|---|---|
build.yml |
build: restore, dotnet format --verify-no-changes, Release build, tests (results and coverage kept as an artifact). package: publish and vpk pack exactly like a release. |
security.yml |
workflow-lint: actionlint + shellcheck on the workflows. scan (ops security.yml): gitleaks over the full history, Opengrep (SAST, report only), osv-scanner, and a NuGetAudit restore that fails on high/critical advisories. Also weekly, Friday 14:11 UTC. |
qodana.yml |
JetBrains Qodana for .NET (Rider's inspections, native mode on Windows) over the whole solution, after a Release build, through the ops reusable-qodana.yml (Qodana CLI); settings in qodana.yaml, and the gate is zero problems. Results go to Qodana Cloud and the qodana-report artifact. Advisory. Needs the QODANA_TOKEN secret. |
release.yml |
Tag-triggered release to Cloudflare R2 and a Gitea release — see RELEASING.md. A manual run on a branch is a dry run. |
announce-release.yml |
Posts a release to Discord (also called by release.yml). |
notify-ci-failure.yml |
Posts a Discord alert when Build, Qodana or Security fails on main (DISCORD_CI_WEBHOOK). |
notify-release-pipeline.yml |
Posts every Release run's result to Discord (DISCORD_RELEASE_PIPELINE_WEBHOOK). |
main is protected on Gitea: no force push or deletion, and changes land through pull requests
whose Build checks pass.
See UPDATES.md for how auto-update works.