bumpy

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 12 Imported by: 0

README

🐫 Go Bumpy

Go package GitHub GitHub go.mod Go version

Go-bumpy is a simple tool for bumping the version of your go project based on Semantic Versioning. Not only does it look at existing tags in your repository, it also reads the version from your go.mod file to determine what the major version of your project is.

It is also capable of pushing the new tag to your remote repository.

⬇️ Installation

go install github.com/survivorbat/go-bumpy/cmd/bumpy@latest

Or check out the releases.

📋 Usage

bumpy [-minor] [-prefix="something/"] [-module="./src"] [-push="origin"] <repository directory>

It will output the new tag name to stdout and logging to stderr.

Options
  • -prefix Prefix the result tag and strip the prefix from the existing tags when searching, if set, skips any tags without this prefix
  • -minor Bump the minor version instead of the patch version
  • -push Push the new tag to the specified remote. If not specified, the tag will not be pushed.
  • -module If your go.mod is not in the root of the directory, you can specify the path here
Examples
Module Suffix Latest Tag Output
None None v0.0.0
None v2.5.0 v2.5.1
v3 None v3.0.0
v3 v3.2.0 v3.2.1
v3 v5.4.3 v3.0.0

🔭 Plans

None yet

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bump

func Bump(bumpConfig BumpConfig) (string, error)

Bump creates a new tag for the given repository, the version identifier is determined by: - The current version of the module, as defined in the go.mod file (the v2 or v3 part) - The latest tag in the repository - The Bump type (minor or patch) - The default of v0.0.0 if there are no tags or go.mod files

Types

type BumpConfig added in v0.3.0

type BumpConfig struct {
	Prefix          string
	Directory       string
	ModuleDirectory string
	Type            BumpType
	RemotePush      string
}

type BumpType

type BumpType int
const (
	BumpTypeMinor BumpType = 1
	BumpTypePatch BumpType = 2
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL