Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/craftypath/nextver
Version increments within your CI/CD pipeline. Works well with SemVer and CalVer.
https://github.com/craftypath/nextver
auto-increment automation ci devops semantic-versioning semver
Last synced: 7 days ago
JSON representation
Version increments within your CI/CD pipeline. Works well with SemVer and CalVer.
- Host: GitHub
- URL: https://github.com/craftypath/nextver
- Owner: craftypath
- License: apache-2.0
- Created: 2020-04-02T08:54:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T01:15:27.000Z (over 1 year ago)
- Last Synced: 2024-06-19T05:36:13.934Z (5 months ago)
- Topics: auto-increment, automation, ci, devops, semantic-versioning, semver
- Language: Go
- Homepage:
- Size: 640 KB
- Stars: 15
- Watchers: 4
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nextver
## Features
- auto-increments major, minor, or patch version when set to `x`:
```
nextver -c 0.0.0 -p 0.x.0 # prints 0.1.0
nextver -c 0.1.0 -p 0.x.0 # prints 0.2.0
# ... and so on ...
```- in case you don't know / care about higher position versions, use `?` to keep their current value:
```
nextver -c 1.2.0 -p '?.x.0' # prints 1.3.0
```- bump versions explicitly, with the auto-increment being reset to `0`:
```
# time for 1.0.0
nextver -c 0.487.0 -p 1.x.0 # prints 1.0.0
nextver -c 1.0.0 -p 1.x.0 # prints 1.1.0```
- add/keep/remove commonly used `v` prefix:
```
nextver -c 0.1.0 -p v0.x.0 # prints v0.2.0
nextver -c v0.2.0 -p v0.x.0 # prints v0.3.0
nextver -c v0.3.0 -p 0.x.0 # prints 0.4.0
```- add/keep/remove pre-release and/or build info:
```
nextver -c 2.1.0 -p 2.x.0+abc # prints 2.2.0+abc
nextver -c 2.2.0+abc -p 2.x.0+abc # prints 2.3.0+abc
nextver -c 2.3.0+abc -p 2.x.0 # prints 2.4.0
```## Usage
```console
$ nextver -h
nextver manages automatic semver versioningUsage:
nextver [flags]Flags:
-c, --current-version string the current version
-h, --help help for nextver
-p, --pattern string the versioning pattern
-v, --version version for nextver
```## CI/CD Example
If your artifact should have major version `0`, but you also want to bump the minor version with each build:
```
currentVersion=$(git describe --abbrev=0)
nextVersion=$(nextver -c "$currentVersion" -p 0.x.0)
git tag "$nextVersion"
git push --tags
# ... use $nextVersion, e.g. to tag a docker image.
```