OpenForm
CLICommands

version

Last updated on

Bump artifact version numbers

Bumps the semantic version in an artifact file.

Usage

ofm version <file> <bump-type>

Arguments

ArgumentDescription
fileArtifact file to bump version
bump-typeBump type or specific version

Bump types

TypeDescriptionExample
majorBump major version1.2.3 → 2.0.0
minorBump minor version1.2.3 → 1.3.0
patchBump patch version1.2.3 → 1.2.4
premajorBump to next major prerelease1.2.3 → 2.0.0-0
preminorBump to next minor prerelease1.2.3 → 1.3.0-0
prepatchBump to next patch prerelease1.2.3 → 1.2.4-0
prereleaseBump prerelease version1.2.3-0 → 1.2.3-1
<version>Set specific version1.2.3 → 2.5.0

Description

The version command reads an artifact file, validates it, updates the version field according to semantic versioning rules, and writes the file back.

Examples

Bump patch version:

ofm version my-form.yaml patch

Bump minor version:

ofm version my-form.yaml minor

Set specific version:

ofm version my-form.yaml 2.0.0

Output

✓ Version bumped: 1.2.3 → 1.3.0

Updated: my-form.yaml

Next steps:
  ofm add my-form.yaml
  ofm commit -m "Bump version to 1.3.0"

Error handling

Invalid bump type:

Error: Invalid bump type: invalid
Valid types: major, minor, patch, premajor, preminor, prepatch, prerelease, or a specific version

Missing version field:

Error: Artifact does not have a version field

See also

  • validate - Validate artifact before versioning
  • new - Create new artifacts with initial version

On this page