Skip to content

nbari/gbump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gbump

Git tag semantic version bumper

crates.io Test & Build codecov

What does it do?

gbump scans all git tags, finds the highest SemVer value (including prerelease/build metadata), prints the current version, and shows the bumped value that would be created next. The tool understands the standard major, minor, and patch increments and can optionally create the annotated tag for you.

How to use it?

To install:

cargo install gbump

You can copy gbump to /usr/local/bin/gbump or somewhere available in your path

For usage type:

$ gbump -h

SemVer options are: patch, minor, major. (defaults to patch)

For example if current version tag is 0.1.1:

Using patch will bump 0.1.1 to 0.1.2

$ gbump patch
0.1.1 --> 0.1.2

Using minor will bump 0.1.1 to 0.2.0

$ gbump minor
0.1.1 --> 0.2.0

Using major will bump 0.1.1 to 1.0.0

$ gbump major
0.1.1 --> 1.0.0

Quiet mode

If only need the next semver, use option -q. for example:

$ gbump -q major
1.0.0

--tag (git tag -a X.Y.Z -m "X.Y.Z")

To create a git tag using the latest bump use the flag -t:

 $ gbump -t minor
 Tag: 0.2.0 created: 5b1eca044a538fd2f74c4f043f28ca4a46b8f7b7

--tag-signed / -ts (git tag -s X.Y.Z -m "X.Y.Z")

Use -ts to create a GPG-signed tag instead of the default annotated tag:

 $ gbump -ts patch
 Tag: 0.0.1 created: <oid>

The command shells out to git tag -s, so make sure your signing key and gpg.program are configured in the repository or environment.

Environment variables

  • GBUMP_FORCE_TAG_FAILURE=1 — forces the internal tag lookup to fail. This is mainly useful for tests or CI workflows where you want to confirm the error path.

About

Git tag semantic version bumper

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published