5.0.0
Features
-
Add GitHub Actions, GitLab CI and Jenkins environment variable support
- GitHub Actions: if
$GITHUB_ACTIONS == true
,GITHUB_REF
is considered - GitLab CI: if
$GITLAB_CI == true
,CI_COMMIT_BRANCH
andCI_COMMIT_TAG
are considered - Circle CI: if
$CIRCLECI == true
,CIRCLE_BRANCH
andCIRCLE_TAG
are considered - Jenkins: if
JENKINS_HOME
is set,BRANCH_NAME
andTAG_NAME
are considered
- GitHub Actions: if
-
Simplify configuration (also see BREAKING CHANGES)
Groovy DSL Example:
build.gradle
version = '0.0.0-SNAPSHOT' gitVersioning.apply { refs { branch('.+') { version = '${ref}-SNAPSHOT' } tag('v(?<version>.*)') { version = '${ref.version}' } } // optional fallback configuration in case of no matching ref configuration rev { version = '${commit}' } }
Kotlin DSL Example:
build.gradle.kts
version = "0.0.0-SNAPSHOT" gitVersioning.apply { refs { branch(".+") { version = "\${ref}-SNAPSHOT" } tag('v(?<version>.*)') { version = "\${ref.version}" } } // optional fallback configuration in case of no matching ref configuration rev { version = "\${commit}" } }
-
New option to consider tag configs on branches (attached HEAD), enabled by
refs { considerTagsOnBranches = true }
- If enabled, first matching branch or tag config will be used for versioning
BREAKING CHANGES
- There is no default config anymore, if no
ref
configuration is matching current git situation and norev
configuration has been
defined a warning message will be logged and plugin execution will be skipped. - Placeholder Changes (old -> new)
${branch}
->${ref}
${tag}
->${ref}
${REF_PATTERN_GROUP}
->${ref.REF_PATTERN_GROUP}
${describe.TAG_PATTERN_GROUP}
->${describe.tag.TAG_PATTERN_GROUP}
preferTags
option was removed- use
refs { considerTagsOnBranches = true }
instead
- use