Skip to content

idelchi/go-next-tag

Repository files navigation

go-next-tag

Go Reference Go Report Card Build Status License: MIT

go-next-tag is a Go tool for calculating the next major-minor or semantic version given a tag.

Installation

From source

go install github.com/idelchi/go-next-tag@latest

From installation script

curl -sSL https://raw.githubusercontent.com/idelchi/go-next-tag/refs/heads/main/install.sh | sh -s -- -d ~/.local/bin

Usage

go-next-tag [flags] [version|STDIN]

Flags and Environment Variables

Flag Environment Variable Description Default Valid Values
--version - Show version - -
--show - Show configuration - -
--bump GO_NEXT_TAG_BUMP Version component to increment patch patch, minor, major, none
--format GO_NEXT_TAG_FORMAT Version format to use auto majorminor, semver, auto
-h, --help - Help for go-next-tag - -

Format Types

Format Description Example
majorminor Two-component version number v1.2
semver Three-component semantic version v1.2.3
auto Inferred from input (defaults to semver) -

Examples

# Bump minor version of a semver tag
go-next-tag --bump minor v1.2.3
# Output: v1.3.0

# Read version from stdin
echo "v1.2.3" | go-next-tag --bump minor
# Output: v1.3.0

# Use majorminor format implicitly
go-next-tag v1.2
# Output: v1.3

# Use majorminor format explicitly
go-next-tag --format majorminor v1.2.3
# Output: v1.3

Notes

  • When version is provided both as stdin and argument, the argument takes precedence
  • With --format=auto, format is inferred from input, defaulting to semver if no input
  • When using majorminor format, --bump patch is equivalent to --bump minor

For detailed help:

go-next-tag --help

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published