Description
Auto semantic version based on selected strategy. Available strategies:
- gitlab-flow
Output variables
GOOPS_SEMVER=1.2.3-SNAPSHOT
GOOPS_SEMVER_RELEASE=1.2.3
GOOPS_SEMVER_MAJOR=1
GOOPS_SEMVER_MINOR=2
GOOPS_SEMVER_PATCH=3
Configuration defaults
GOOPSC_SEMVER=false
GOOPSC_SEMVER_STRATEGY=gitlab-flow
gitlab-flow strategy
This strategy is designed for Gitlab flow with release branches. Which is described in Gitlab documentation
rules for master branch
- Find previous tag. If there are no tags previous tag will be assumed as 0.0.0
- Bump previous tag minor version and set patch version to 0.
- If *-stable branch matching version exists bump minor version once more.
- Append "-SNAPSHOT" to version.
rules for *-stable branches
- If HEAD is tagged use tag as version.
- Else find previous tag and bump patch version.
- If tag not exists take version from branch name and set patch to 0.
| current branch | tag | previousTag | stableBranch | version | release version |
|---|---|---|---|---|---|
| master | 0.1.0-SNAPSHOT | 0.1.0 | |||
| master | 0.1-stable | 0.2.0-SNAPSHOT | 0.2.0 | ||
| master | 0.1.0 | 0.1-stable | 0.2.0-SNAPSHOT | 0.2.0 | |
| master | 0.1.1 | 0.1-stable | 0.2.0-SNAPSHOT | 0.2.0 | |
| master | 0.1.1 | 0.1.0 | 0.1-stable | 0.2.0-SNAPSHOT | 0.2.0 |
| 0.1-stable | 0.1-stable | 0.1.0-SNAPSHOT | 0.1.0 | ||
| 0.1-stable | 0.1.0 | 0.1-stable | 0.1.0 | 0.1.0 | |
| 0.1-stable | 0.1.0 | 0.1-stable | 0.1.1-SNAPSHOT | 0.1.1 | |
| 0.1-stable | 0.1.1 | 0.1.0 | 0.1-stable | 0.1.1 | 0.1.1 |
| 0.2-stable | 0.2-stable | 0.2.0-SNAPSHOT | 0.2.0 |