Skip to content

Release & versioning

How the MainframeEngine NuGet packages and the Demo zip are versioned, built and released. What the package contains and how games consume it: Distribution via NuGet. The editor releases from its own repository, mainframe-editor, with its own version, tags and self-updates (ADR 0289).

main is protected by the main-protection repository ruleset (no bypass actors, admins included):

  • changes land only through pull requests; squash or rebase merges (merge commits are disabled);
  • the ci-success check (ci.yml) must pass, on a branch that is up to date with main;
  • linear history; no force pushes; no deletion.

Release tags (v*) are immutable (release-tags-immutable ruleset: no update, no deletion).

SemVer. The version lives only in git tags vX.Y.Z; nothing in the repo is bumped. Local builds are 0.0.0-dev (Directory.Build.props); releases pass -p:Version=X.Y.Z.

Each publish bumps the latest vX.Y.Z tag (build/next-version.sh; first release v1.0.0) by its bump input: patch by default, minor (v1.0.1 → v1.1.0) or major (→ v2.0.0), e.g. gh workflow run publish.yml --ref main -f bump=minor. just next-version [patch|minor|major] prints what the next publish would create.

The editor has a version of its own (ADR 0289). -p:MainframeEngineVersion=X.Y.Z sets the engine’s projects’ version alone (Directory.Build.props), so a build that stamps another version on its own projects, such as the editor’s, keeps the engine’s. EngineInfo.Version is the engine’s version: the editor records it in new projects’ project.mfproj (engineVersion) and references the MainframeEngine package of that version, the editor link handshake carries it, and the package (distribution via NuGet) uses it as its package version.

publish.yml — Actions → publish → Run workflow on main.

flowchart LR
    G["guard<br/>main only · actor brogan89<br/>next version"] --> C["ci.yml<br/>(full suite, reused)"]
    C --> D["demo<br/>build/package-example.sh<br/>MainframeEngine.Demo-vX.Y.Z.zip"]
    C --> P["package<br/>build/pack-nuget.sh<br/>MainframeEngine + .Templates X.Y.Z"]
    D --> R["release<br/>tag vX.Y.Z + GitHub Release<br/>+ Demo zip + .nupkg"]
    P --> R
    R --> N["nuget.org<br/>Trusted Publishing (OIDC)<br/>dotnet nuget push"]
  • Who/where. The guard job runs only when github.ref == refs/heads/main and github.actor == brogan89; every other job depends on it, so a dispatch from another branch or user skips the whole run. Jobs also run in the release environment, whose deployment branch policy allows main only. (Required reviewers on environments need GitHub Enterprise for private repos, so the actor check is the gate.)
  • Tests first. The full CI suite runs again (workflow_call) before anything is packed.
  • Symbols (G15.8, Crash reporting). The engine package’s symbols ship as its .snupkg; the editor’s releases attach their own symbols zip. Games choose with an export preset’s symbols (ship or separate: a <exe>-<version>-<rid>-symbols.zip beside the export, PDBs out of it; Game export).
  • NuGet packages. The package job runs build/pack-nuget.sh with the release version: MainframeEngine.X.Y.Z.nupkg + .snupkg (engine, generator, natives, content, mf-l10n) and MainframeEngine.Templates.X.Y.Z.nupkg (mfgame, defaulting to the engine of the same version); see Distribution via NuGet. The release job attaches both .nupkg files to the GitHub Release and, last of all, pushes them to nuget.org through Trusted Publishing. NuGet/login exchanges the job’s OIDC token for a 1-hour key against a policy owned by the Mainframe-Games organization (workflow publish.yml, environment release), so there is no stored API key or secret and the packages belong to the organization; NUGET_USER in the workflow is the policy creator’s nuget.org username (setup). The push comes after the tag because a nuget.org package can only be unlisted, never deleted; --skip-duplicate makes a re-run harmless.
  • Docs site. A successful run triggers docs.yml (workflow_run), which builds the docs from the released commit and deploys them to GitHub Pages with the new version in the title. This is the only automatic docs deploy: merges to main do not publish docs (Docs site).
  • Demo asset. The demo job (needs guard and ci; the release waits for it) pulls the Demo’s LFS content and runs build/package-example.sh Demo <version> <out-dir> (build/package-demo.sh <version> <out-dir> is its wrapper). It zips Examples/Demo (tracked and unignored files, no bin//obj/, failing on LFS pointer files) under a top folder MainframeEngine.Demo/ as MainframeEngine.Demo-vX.Y.Z.zip (plus a generated Directory.Packages.props with the versions of the packages the Demo references, read from the repo’s, since the Demo builds outside it), attached to the release under its versioned name only. The editor’s Download Example menu fetches the zip of the engine version it was built against, and the editor repo’s CI checks a Demo zip (--validate-demo-zip). The Forest and Neon zips release from mainframe-engine-showcase.

build/release-notes.sh <tag> [target] [previous-tag] writes the release body: GitHub’s generated notes (the PRs since the previous release, New Contributors, Full Changelog) with “What’s Changed” grouped under headers by each PR title’s Area: prefix, in a fixed order: Rendering (Shaders, Vulkan, …), Physics, Audio, Navigation, UI, Core (Content, Gameplay toolkit, …), Editor, Examples (Demo, Forest, Neon), Build & Tooling (Build, Release, Tests, Tools, Workflow, …), Docs (Docs, Docs site), Other (no prefix, or one not in the script’s map). Bullets keep the prefix: * Shaders: … by @user (#160). Name new PRs with a prefix from the map, or add the new prefix to it. Preview the next release’s notes locally with build/release-notes.sh v<next> main (the tag need not exist).

The name macOS shows — Dock tooltip, the bold app menu next to the Apple menu, Cmd+Tab, Finder — comes from the CFBundleName/CFBundleDisplayName of the bundle the executable runs from, once, when the process registers with LaunchServices (ADR 0096). One template, build/macos/Info.plist.in (@NAME@, @BUNDLE_ID@, @EXECUTABLE@, @ICON_FILE@, @VERSION@), feeds the release bundles and the development bundles that build/macos/DevAppBundle.targets assembles after a macOS build of an executable that sets MacAppDisplayName (games, and the editor in its own repository).

In development the build output stays where it is: the bundle’s Contents/MacOS/<exe> is a symlink to the apphost, and the .NET apphost resolves its own path with realpath, so the app base directory (assemblies, Assets/) is still bin/<cfg>/net11.0/, while CoreFoundation picks the main bundle from the unresolved exec path. A .dev identifier suffix keeps development builds apart from an installed release (LaunchServices, preferences, permissions). dotnet run starts the bundle path directly (not via open), so console output, exit codes and Ctrl+C are unchanged. RID-specific builds/publishes skip the dev bundle; -p:MacDevAppBundle=false turns it off. Starting bin/…/<exe> itself still works and shows the executable name. Changing the name in-process does not work: NSProcessInfo.processName (even set before NSApplication exists) and SDL hints leave the LaunchServices name alone; only private LaunchServices calls could change it.

The same targets wrap every game’s desktop executable, so dotnet run / just forest show the game’s name and icon instead of MyGame.Desktop and a blank icon. build/MainframeGame.props (imported by every game project) reads project.mfproj and imports the targets:

MSBuild propertyDefault (game)Use
MacAppDisplayName"name" (MainframeAppName)bin/<cfg>/net11.0/<name>.app, CFBundleName/CFBundleDisplayName
MacAppBundleIdcom.mainframegames.<name, letters/digits/hyphens, lower case>CFBundleIdentifier (+ MacAppBundleIdSuffix, default .dev)
MacAppIcon"window.icon" (a PNG, converted by build/macos/png-to-icns.sh into obj/, once per change)an .icns is copied as is: set it for an icon on Apple’s grid
MacAppVersion"version", else $(Version)CFBundleShortVersionString/CFBundleVersion

The props also set Product (every game assembly) and the executable’s AssemblyTitle (the Windows file description) to the name; the Windows exe icon is the desktop project’s ApplicationIcon (an .ico). On Windows the SDK writes the icon and version strings into the apphost only when building on Windows. Bundles are built for executables only (not IsTestProject), skipped for RID-specific builds and with -p:MacDevAppBundle=false. The editor’s Play launches the game through <name>.app/Contents/MacOS/<assembly> when it exists (ProcessGameLauncher.FindLauncherProgram).

On macOS an SDL window icon only replaces the Dock icon, so GameHost skips window.icon when the process runs from a bundle that names an icon (MacAppBundle.HasIcon, CoreFoundation’s main bundle CFBundleIconFile): the Dock keeps the .icns. Unbundled runs (dotnet Game.Desktop.dll, the scripts) still get window.icon, which is full-bleed for Windows and Linux. The template smoke test (just template-smoke) checks SmokeGame.app’s Info.plist and icon.

Release bundles, a game’s <Name>.app (the export’s AppBundleWriter) and the editor’s Mainframe Editor.app (built in its own repository), pass codesign --verify --deep --strict (issue #105) with this layout:

PathHolds
Contents/MacOS/<exe>the apphost alone (and any helper executable)
Contents/MonoBundle/the rest of the publish: assemblies, *.deps.json/*.runtimeconfig.json, the runtime’s dylibs (libhostfxr, libhostpolicy, libcoreclr, …, createdump), the engine’s and packages’ dylibs (libmfrmlui, libSDL2, libMoltenVK, libsteam_api, …), steamworks/posix/, Assets/, project.mfproj
Contents/Resources/Apple’s resources: the .icns
Contents/Info.plist, Contents/_CodeSignature/

Why: Apple treats every file in Contents/MacOS as code, so a managed DLL there fails the check (“not signed”); and Contents/Resources is for resources, not code. The .NET host cannot split managed and native files: a self-contained apphost loads libhostfxr from the folder of the app’s .dll, and hostpolicy and coreclr come from the same folder. So everything but the apphost lives in one folder outside the code locations, Contents/MonoBundle, where .NET for macOS also puts its assemblies and dylibs. codesign seals it as resources (any change breaks the bundle signature) and the signing step signs each Mach-O in it.

How the apphost finds its app: the SDK writes the app’s path, relative to the apphost, into the apphost (“<assembly>.dll”, beside it). An osx publish with -p:MacBundleAppDirectory=MonoBundle (build/macos/BundleAppHost.targets, imported by MainframeGame.props and the editor repo’s project) rewrites the published apphost with the SDK’s own CreateAppHost task (and its ad-hoc signature, on any OS) as “../MonoBundle/<assembly>.dll”. The host resolves that path and takes its folder as the app’s root, so AppContext.BaseDirectory is Contents/MonoBundle/ and everything resolved against it works unchanged: ContentPaths, SilkNativeResolver, VulkanLoaderBootstrap (MoltenVK), mfrmlui/enet (DllImport, the app folder is a native search directory), SteamworksLoader (steamworks/posix/), ModelImporter (assimp). The export passes the property for osx RIDs; the editor’s project sets it, so any osx publish of the editor is for the bundle (its folder does not start on its own). No symlink is involved: an earlier layout reached Contents/Resources/<assembly>.dll through a Contents/MacOS symlink, which breaks if a copy dereferences it (some archivers and uploaders do).

Signing (build/macos/sign-app.sh, which the editor repo uses; its C# twin MacSigner in the export for games) goes inside out and never uses --deep: every Mach-O except the main executable, deepest first, then the bundle (which signs the apphost and seals the rest), then codesign --verify --deep --strict --verbose=2. Ad hoc by default (Apple Silicon refuses unsigned code; no hardened runtime). With a Developer ID every Mach-O gets the hardened runtime and a secure timestamp; the main executable the .NET entitlements (allow-jit, allow-unsigned-executable-memory, disable-library-validation), and a --helper its own entitlements (the editor’s mfplughost). On Linux and Windows there is no codesign, so a game’s macOS preset does not validate (host-unsupported), so build macOS packages on a Mac.

Games are exported from export presets in project.mfproj with one C# pipeline, ExportRunner (Game export): the editor’s File › Export…, mf-export (just export --project <dir> --preset "<name>" | --all | --list), the editor’s --export-release/--export-debug/--export-all flags and CI all run it. just package-game <Desktop.csproj> <rid> <out-dir> [--name] [--exe] [--version] [--bundle-id] [--copyright] [--icon] [--sign] [--notarize] [--demo] [--steam] [--symbols ship|separate] keeps the old build/package-game.sh arguments (gone) as an unsaved preset.

An export is a self-contained (by default), ReadyToRun, untrimmed dotnet publish for one RID with its intermediates under the project’s .mainframe/export/obj/<rid>-<full|demo> (--artifacts-path, away from the editor’s bin//obj/), the apphost renamed to the player-facing executable, the engine’s natives and steamworks/ folder of other platforms removed, the game’s Assets/ filtered by the preset’s globs, Assets/assets.index.json written, and a project.mfproj without presets (Steam’s app ids zeroed when the preset has Steam off). It fails if the stage holds a steam_appid.txt. Then per platform:

RIDOutputNotes
osx-*<exe>-<version>-<rid>.zip with <Name>.appthe macOS bundle layout (the apphost alone in Contents/MacOS, the rest of the publish in Contents/MonoBundle), which passes codesign --verify --deep --strict; Info.plist (name, bundle id, version, copyright, games category), the desktop project’s MacAppIcon when it is an .icns, else an .icns written in C# from the PNG, in Contents/Resources; signed inside out, ad hoc by default (Apple Silicon refuses unsigned code). A preset’s sign (or MF_SIGN_IDENTITY) signs each Mach-O and then the bundle with that identity, the hardened runtime, a timestamp and the .NET entitlements; notaryProfile (or MF_NOTARY_PROFILE, from xcrun notarytool store-credentials) then submits, staples and re-zips. Needs a macOS host
win-*<exe>-<version>-<rid>.zipa GUI-subsystem exe, so players get no console window (-p:MainframeWindowsGui=true: MainframeGame.props publishes the launcher as WinExe; dotnet run and dev builds keep the console); the desktop project’s ApplicationIcon, else an .ico written in C# from the PNG. Works from any host
linux-*<exe>-<version>-<rid>.tar.gzUnix modes set in the archive from any host; also the dedicated server (<exe> --headless ++ …, ADR 0120)

archive: false leaves <output>/<exe>-<version>-<rid>/ (a Steam depot’s content root). symbols: separate writes <exe>-<version>-<rid>-symbols.zip beside it (Crash reporting → Symbols). Defaults: the version from project.mfproj (else 0.0.0), the exe from the name without spaces, the icon from window.icon. No external tools are needed for icons or archives (macOS still uses codesign, ditto and xcrun).

Checkout and package games use the same exporter. MainframeGame.props (imported by checkout games, and by package games as buildTransitive) sets MainframeExportTool: the MainframeEngine package’s tools/mf-export/mf-export.dll, or the checkout’s Tools/MainframeEngine.Export.Cli project:

Terminal window
mf_export="$(dotnet msbuild MyGame.Desktop -getProperty:MainframeExportTool)"
dotnet "$mf_export" --project . --preset "Windows" # a package game; --all, --list
dotnet "$mf_export" MyGame.Desktop/MyGame.Desktop.csproj osx-arm64 builds # without a preset

CI’s template job exports the template game for its host RID with mf-export --preset, unpacks it and runs it headless, and packages a package game for linux-x64 and win-x64 with the package’s mf-export, checking each archive’s contents, Steam files included (Distribution via NuGet → Tests).

Editor updates (editor repo) · Build & platforms · Testing · Distribution via NuGet