BumpVersion
Bump the version of all packages using a Semantic Versioning rule.
You must define at least one package (defined by default if not using a knope.toml
file.
It may be easier to select the appropriate version automatically based on recent changes. Check out the automating releases tutorial.
Fields
rule
: The Semantic Versioning rule to use.label
: Only applicable toPre
rule
. The pre-release label to use.
Examples
Single package pre-release
With this particular example, running knope pre-release
would bump the version in Cargo.toml
using the pre
rule and the rc
label.
So if the version was 0.1.2-rc.0
, it would be bumped to 0.1.2-rc.1
.
Multiple Packages
This step runs for each defined package independently.
In this example,
running knope major
would bump the version in knope/Cargo.toml
and knope-utils/Cargo.toml
using the “major” rule.
If the versions in those files were 0.1.2
and 3.0.0
respectively,
Knope would bump them to 0.2.0
and 4.0.0
respectively.
Rules
Major
Increment the Major component of the semantic version and reset all other components (for example, 1.2.3-rc.4 -> 2.0.0).
Minor
Increment the Minor component of the semantic version and reset all lesser components (for example, 1.2.3-rc.4 -> 1.3.0 ).
Patch
Increment the Patch component of the semantic version and reset all lesser components (for example, 1.2.3-rc.4 -> 1.2.4).
Pre
Increment the pre-release component of the semantic version or add it if missing. You must also provide a label
parameter to this rule which will determine the pre-release string used. For example, running this rule with the label
rc
would change 1.2.3-rc.4
to 1.2.3-rc.5
or 1.2.3
to 1.2.4-rc.0
.
Release
Remove the pre-release component of the semantic version (for example, 1.2.3-rc.4 -> 1.2.3).
Errors
This step will fail if any of the following are true:
- The version string is malformed. Note that Knope only supports a subset of pre-release version formats.
- The [package config] is missing or invalid.