jiro4989 / semtag

A semantic versioning library and command in Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Semtag

Table of Contents

WIP

1. Usage

1.1. Library

1.2. CLI

1.2.1. New tag

$ semtag new
DRYRUN: v0.1.0

$ semtag new -run
v0.1.0

$ git tag
v0.1.0

1.2.2. New tag with suffix

$ semtag new -suffix module-a
DRYRUN: v0.1.0-module-a

$ semtag new -suffix module-a -run
v0.1.0-module-a

$ git tag
v0.1.0-module-a

1.2.3. New tag with path suffix

$ semtag new -path-suffix ./cmd/semtag/
DRYRUN: v0.1.0-cmd-semtag

$ semtag new -path-suffix ./cmd/semtag/ -run
v0.1.0-cmd-semtag

$ git tag
v0.1.0-cmd-semtag

$ semtag new -path-suffix ./cmd/semtag/main.go
DRYRUN: v0.1.0-cmd-semtag-main.go

$ semtag new -path-suffix ./cmd/semtag/main.go -run
v0.1.0-cmd-semtag-main.go

$ git tag
v0.1.0-cmd-semtag
v0.1.0-cmd-semtag-main.go

1.2.4. Bump patch/minor/major

$ git tag v0.1.0

$ semtag patch
DRYRUN: v0.1.1

$ semtag patch -run
v0.1.1

$ git tag
v0.1.0
v0.1.1

$ semtag minor
DRYRUN: v0.2.0

$ semtag minor -run
v0.2.0

$ git tag
v0.1.0
v0.1.1
v0.2.0

$ semtag major
DRYRUN: v1.0.0

$ semtag major -run
v1.0.0

$ git tag
v0.1.0
v0.1.1
v0.2.0
v1.0.0

1.2.5. Bump from stdin

$ git tag v0.1.0-module-a
$ git tag v0.1.0-module-b
$ git tag v0.1.1-module-b
$ git tag v0.1.0-module-c

$ git tag | sort -V | grep module-b | semtag patch -stdin
DRYRUN: v0.1.2-module-b

$ git tag | sort -V | grep module-b | semtag patch -stdin -run
v0.1.2-module-b

$ git tag | sort -t- -k3
v0.1.0-module-a
v0.1.0-module-b
v0.1.1-module-b
v0.1.2-module-b
v0.1.0-module-c
$ git tag v0.1.0-module-a
$ git tag v0.1.0-module-b
$ git tag v0.1.1-module-b
$ git tag v0.1.0-module-c

$ semtag patch -search module-b
DRYRUN: v0.1.2-module-b

$ semtag patch -search module-b -run
v0.1.2-module-b

$ git tag | sort -t- -k3
v0.1.0-module-a
v0.1.0-module-b
v0.1.1-module-b
v0.1.2-module-b
v0.1.0-module-c

About

A semantic versioning library and command in Golang.


Languages

Language:Go 94.8%Language:Shell 3.5%Language:Makefile 1.7%