dotnet-semver
1.2.0
dotnet tool install --global dotnet-semver --version 1.2.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local dotnet-semver --version 1.2.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-semver&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package dotnet-semver --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
dotnet-semver
dotnet-semver
is a dotnet re-implementation of the ruby semver2 gem cli.
Quickstart
Install
dotnet tool install -g dotnet-semver
Use
# Initialize the .semver file.
dotnet semver init
# Find the .semver file and print a formatted string from this.
dotnet semver # => v0.1.0
dotnet semver inc major # => v1.0.0
dotnet semver inc minor # => v1.1.0
dotnet semver pre "alpha.45" # => v1.1.0-alpha.45
dotnet semver meta "md5.abc123" # => v1.1.0-alpha.45+md5.abc123
dotnet semver format "%M.%m.x" # => 1.1.x
dotnet semver meta # => v1.1.0-alpha.45
dotnet semver inc minor # => v1.2.0-alpha.45
cat .semver
---
:major: 0
:minor: 2
:patch: 0
:special: 'alpha.45'
:metadata: ''
Wrap dotnet CLI Commands
dotnet-semver
can wrap the dotnet cli commands build
, pack
and publish
, automatically adding the necessary version switch to the command line.
For example the command:
dotnet semver build --configuration Release
is executed as:
dotnet build /p:Version=1.2.0-alpha.45 --configuration Release
Git Integration
git config alias.semtag '!git tag -a $(dotnet semver tag) -m "tagging $(dotnet semver tag)"'
Usage
USAGE: dotnet semver [--help] [init [--force] | inc <version> | pre <value> | meta <value> | tag | next <version> | format [-n] <format>]
OPTIONS:
--help - Display this list of options.
--force - Force creation of a new .semver file, even if one already exists.
-n - Do not output a trailing newline.
SUBCOMMANDS:
init[ialize] [--force] - Initializes a new .semver file with an initial version v0.1.0.
inc[rement] <version> - Increments the specified version number according to semver2 rules. <version> must be one of [major|minor|patch].
pre[release] <value> - Sets the pre-release version suffix.
meta[data] <value> - Sets the metadata value.
next <version> - Format incremented specific version without saving it. <version> must be one of [major|minor|patch].
tag - Print the tag for the current .semver file.
format [-n] <format> - Find the .semver file and print a formatted string from this..
DOTNET CLI WRAPPERS:
build [args] - Executes dotnet build, passing the current semver as a switch.
pack [args] - Executes dotnet pack, passing the current semver as a switch.
publish [args] - Executes dotnet publish, passing the current semver as a switch.
Format String Tokens
- Major:
%M
- Minor:
%m
- Patch:
%p
- Special:
%s
- Metadata:
%d
Credits
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
1.2.0 | 117 | 12/2/2024 |
1.1.0 | 144 | 8/3/2024 |
1.0.0 | 131 | 6/2/2024 |
1.0.0-beta.4 | 82 | 5/16/2024 |
1.0.0-beta.3 | 110 | 5/15/2024 |