github.com/crosseyed/versionbump@v1.1.0/README.md (about) 1 # versionbump 2 3 versionbump is a tool to automatically bump version contained in a file. 4 5 ## Usage 6 7 ```bash 8 % versionbump --help 9 Usage: 10 versionbump (major|minor|patch) [--checktags] <file> 11 versionbump list <file> 12 13 Options: 14 -h --help Show this screen. 15 --version Show version. 16 -c --checktags Avoid bumping if current version is not tagged. 17 <file> Name of file. 18 major major bump. 19 minor minor bump. 20 patch patch bump. 21 list Show version from file. 22 23 ``` 24 25 ## Examples 26 27 **Minor Version Bump** 28 ```bash 29 % cat ./VERSION 30 1.0.0 31 % versionbump minor ./VERSION 32 % cat ./VERSION 33 1.1.0 34 ``` 35 36 **Version Embeded in a Makefile** 37 ``` 38 # Makefile 39 PROJECT = someproject 40 COMMITSHA = $(shell git rev-parse --short HEAD) 41 VERSION = 2.1.0 42 43 release: 44 git tag $(VERSION) 45 git push --tags 46 ``` 47 48 Update Version 49 ```bash 50 versionbump list ./Makefile 51 2.1.0 52 versionbump major ./Makefile 53 versionbump list ./Makefile 54 3.0.0 55 ``` 56 57 ``` 58 # Makefile 59 PROJECT = someproject 60 COMMITSHA = $(shell git rev-parse --short HEAD) 61 VERSION = 3.0.0 62 63 release: 64 git tag $(VERSION) 65 git push --tags 66 ```