WarHub.ArmouryModellibrary andwhamtool
Foundational .NET library for wargame datafile tools, written in C#.
This is the home of the WarHub.ArmouryModel library handling wargame roster and data files.
It consists of:
wham- a CLI tool (Command Line) used to manage, convert and publish datafiles, distributed as .NET Global Tool (.NET SDK v10+ required)WarHub.ArmouryModel.Sourcelibrary provides API to manage and interact with wargaming data files (game systems, catalogues) and rosters.WarHub.ArmouryModel.Source.BattleScribeprovides convenient methods to load and save BattleScribe XML datafiles.WarHub.ArmouryModel.ProjectModellibrary provides API to operate on wham workspaces (abstraction) and their configuration (.whamprojconfiguration files).WarHub.ArmouryModel.Workspaces.BattleScribeimplements project model for BattleScribe format.WarHub.ArmouryModel.Workspaces.Gitreeimplements project model for gitree where directory and file structure is a part of datafile shape, building datafile from massive amounts of tiny files. It's mostly designed to work well with VCS (Version Control Systems) such as git.
All libraries, unless otherwise specifed, target .NET 10.
There are also test projects and WarHub.ArmouryModel.Source.CodeGeneration project which contains
code generator used to build .Source library. This code generator uses C# Source Generators.
To install wham command line tool:
- please install
.NET SDKv10 for your platform. - In your shell/command line run
dotnet tool install wham -g - You can check if the tool is available:
wham --versionshould show what version exactly is running.
This will install preview of wham CLI tool in your user-space (not system global),
and so it doesn't require root/admin permissions. (Although installation of .NET SDK can).
- converts BattleScribe workspace (xml files:
.cat/.catz/.gst/.gstz) into gitree workspace (mutliple small files in directory trees) that behaves with git well. - publishes BattleScribe format distribution files:
.bsrrepository distribution package - zip archive containing datafiles (.catand.gst) and DataIndexindex.xmlfile.index.bsiwhich is DataIndexindex.xml-containing zip archive.index.xmlDataIndex..cat/.gstdatafiles.catz/.gstzzipped datafiles
You can always run wham -? or wham -h or wham [action] -? to get help about the tool/action.
The development branch is the main branch. Stable releases are marked via vX.Y.Z tags.
This project uses Nerdbank.GitVersioning package that automatically generates version numbers
for assemblies and packages from git tree. It won't work if the git clone is shallow or otherwise
incomplete.
- Create a PR that sets
version.jsonto the stable version (e.g."0.14") and updatesCHANGELOG.mdwith the release date. Merge the PR. - Tag the merged commit:
git tag vX.Y.Z && git push origin vX.Y.Z - After tagging, create a PR to bump
version.jsonto the next alpha version (e.g."0.15.0-alpha.{height}") and add an[Unreleased]section toCHANGELOG.md.
Packages are published via the Publish workflow (.github/workflows/publish.yml).
Via GitHub CLI or Actions UI (recommended):
# Publish to GitHub Packages only
gh workflow run publish.yml -f ref=vX.Y.Z -f push-to=github
# Publish to nuget.org only
gh workflow run publish.yml -f ref=vX.Y.Z -f push-to=nuget
# Publish to both registries
gh workflow run publish.yml -f ref=vX.Y.Z -f push-to=allVia ChatOps (requires SLASH_COMMAND_DISPATCH_TOKEN secret):
Comment on any issue or PR:
/deploy ref=vX.Y.Z env=all
NuGet.org publishing uses Trusted Publishing (OIDC) instead of long-lived API keys. The trusted publishing policy is configured on nuget.org for:
| Field | Value |
|---|---|
| Package Owner | warhub |
| Repository Owner | WarHub |
| Repository | wham |
| Workflow | publish.yml |
| Environment | package-release |
The push job in publish.yml uses environment: package-release which provides
environment protection rules (e.g. required reviewers) as a gate before publishing.
The NuGet profile name is configured via the NUGET_USER_NAME environment secret
on the package-release environment.
Tags can also be created via the Tag workflow:
gh workflow run tag-command.yml -f ref=mainOr via ChatOps: /tag ref=main
The library is MIT licensed (license in repo root). Created by Amadeusz Sadowski (@amis92). BattleScribe name is used without permission under fair-use laws.