-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Burke
committed
Feb 10, 2016
1 parent
ee9cfb9
commit e73b18c
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# bump_version | ||
|
||
This is a tool for bumping version numbers in Go files. | ||
|
||
## Installation | ||
|
||
For the moment, you'll need a working Go installation. | ||
|
||
``` | ||
# Note the 2nd bump_version here - it's the command line package | ||
go get github.com/Shyp/bump_version/bump_version | ||
``` | ||
|
||
That will install the `bump_version` binary to your `$GOPATH`. | ||
|
||
## Usage | ||
|
||
``` | ||
bump_version <major|minor|patch> <filename> | ||
``` | ||
|
||
This will: | ||
|
||
1. Look for a `const` named `version`, `VERSION`, or `Version` in that file. | ||
Here's an example: | ||
|
||
```go | ||
package main | ||
|
||
const VERSION = "0.2.1" | ||
``` | ||
|
||
The VERSION should be a string in one of these formats: "3", "0.3", | ||
"0.3.4". Any prefixes like "v" or suffixes like "0.3.3-beta" will be | ||
stripped or generate an error. | ||
|
||
2. Apply the version bump - `bump_version major` will increment the major | ||
version number, `bump_version minor` will increment the middle version number, | ||
`bump_version patch` will increment the last version number. If your version is | ||
"0.3" and you ask for `bump_version minor`, the new version will be "0.4". | ||
|
||
3. Write the new file to disk, with the bumped version. | ||
|
||
4. Add the file with `git add <filename>`. | ||
|
||
5. Add a commit with the message "x.y.z" (`git commit -m "<new_version>"`) | ||
|
||
6. Tag the new version. | ||
|
||
If any of these steps fail, `bump_version` will abort. |