Skip to content

5.0.0

Compare
Choose a tag to compare
@qoomon qoomon released this 17 Aug 08:31
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 and CI_COMMIT_TAG are considered
    • Circle CI: if $CIRCLECI == true, CIRCLE_BRANCH and CIRCLE_TAG are considered
    • Jenkins: if JENKINS_HOME is set, BRANCH_NAME and TAG_NAME are considered
  • 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 no rev 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