Install the Mister.Version CLI (mr-version) for semantic versioning in monorepos.
This action installs the Mister.Version.CLI .NET tool with
dotnet tool install --tool-path into the runner tool cache, adds it to PATH, and verifies that it starts.
It does not install .NET: run actions/setup-dotnet first.
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # mr-version needs the full history and tags
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: mr-version/setup@main
with:
version: 'latest'The repository has a v1 tag, but it points at the initial check-in (June 2025) and predates the fixes described
here (Node 24 runtime, working cache, DOTNET_ROOT handling). Until a new release tag is published, reference
@main or pin a commit SHA.
| Input | Description | Required | Default |
|---|---|---|---|
version |
latest (newest stable), prerelease (newest including prereleases), a specific version such as 3.0.0, or a path to a local Mister.Version.CLI.<version>.nupkg |
No | latest |
cache |
Cache the installed tool with the GitHub Actions cache service | No | true |
dotnet-version |
Deprecated, ignored. This action never installed .NET; use actions/setup-dotnet |
No |
| Output | Description |
|---|---|
tool-path |
Directory containing the mr-version executable (added to PATH) |
cache-hit |
true when the tool was restored from the cache (or was already present in the runner tool cache) |
version |
Version of Mister.Version.CLI that was installed |
- A .NET SDK must be on
PATH(dotnet tool installanddotnet tool searchneed it). Useactions/setup-dotnet. - The tool runs on the .NET 8 runtime. Builds of the CLI after 3.0.0 set
RollForward=Major, so they also run when only a newer runtime (.NET 9, .NET 10, ...) is installed. Version 3.0.0 and earlier need a .NET 8 runtime; to run them on a newer runtime only, setDOTNET_ROLL_FORWARD: Majorin the job environment. - The installed
mr-versionshim finds .NET throughDOTNET_ROOTor the operating system's default install location; it does not searchPATH.actions/setup-dotnetsetsDOTNET_ROOT. When it is not set (for example .NET installed into~/.dotneton a self-hosted runner), this action derives the install directory from thedotnetonPATHand exportsDOTNET_ROOTfor the following steps.
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: mr-version/setup@main
- run: mr-version report --output text - uses: mr-version/setup@main
with:
version: '3.0.0' - uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- uses: mr-version/setup@main
with:
version: '3.0.0'
env:
DOTNET_ROLL_FORWARD: Major # only needed for CLI versions without RollForward=Major (3.0.0 and earlier) - run: dotnet pack mister.version/Mister.Version.CLI -c Release -o ./nupkg -p:PackageVersion=3.0.1-local.1
- uses: mr-version/setup@main
with:
version: './nupkg/Mister.Version.CLI.3.0.1-local.1.nupkg'The path is resolved against GITHUB_WORKSPACE. It may also point at a directory that contains exactly one
Mister.Version.CLI.*.nupkg. Local packages are never cached. Give local builds a version that is not published on
nuget.org: NuGet prefers its global packages folder over the local file when the version already exists there.
With cache: true the tool directory is saved with the GitHub Actions cache service (@actions/cache 5.x, which
uses the current cache service) under the key mister-version-nuget-<version>-<os>-<arch>, and restored on later
runs. When the cache service is unavailable (GHES without caching, local runs) caching is skipped with a message.
A failed save is reported as a warning and never fails the step; "Tool cached for future use" is only logged when the
save succeeded.
On self-hosted runners the tool directory under RUNNER_TOOL_CACHE survives between jobs and is reused directly.
To always install fresh:
- uses: mr-version/setup@main
with:
cache: 'false'The step fails (instead of installing a different version) when:
dotnetis not onPATH;latest/prereleasecannot be resolved becausedotnet tool searchfails (setversionto a specific version to skip the lookup);- the requested version does not exist on the configured NuGet feeds;
mr-version --helpdoes not run after installation (the error explains DOTNET_ROOT and runtime problems).
This action is part of the Mister.Version project and is licensed under the MIT License.