jmongard / Git.SemVersioning.Gradle

Gradle plugin for automatically versioning a project using semantic versioning and conventional commits with change log support based on git commit messages.
https://plugins.gradle.org/plugin/com.github.jmongard.git-semver-plugin
Apache License 2.0
38 stars 4 forks source link

Duplicate releases are created #13

Closed ghost closed 2 years ago

ghost commented 2 years ago

I got every release is done twice when ./gradlew releaseVersion is executed. Configuration is default, plugin version is 0.4.2. image Any ideas?

jmongard commented 2 years ago

Hi, You should only include the plugin in the root project in a multi project setup and then use the allprojects config to set the version on each sub project.

allprojects {
    version = semver.version
}

Could this be the cause of your issue?

ghost commented 2 years ago

Well, if I don't apply plugin inside the allprojects I can't use semver extension there:

plugins {
    kotlin("jvm") version "1.6.21"
    id("com.github.jmongard.git-semver-plugin") version "0.4.2"
}

allprojects {
    version = semver.version
    repositories { mavenCentral() }
}

gives me

Extension with name 'semver' does not exist. Currently registered extension names: [ext]
jmongard commented 2 years ago

Ok, it looks like some there is some problem using kotlin DSL or maybe somthing changed in latest gradle release. This works when I test:

plugins {
    id("com.github.jmongard.git-semver-plugin") version "0.4.2"
}

val ver = semver.version;

allprojects {
    version = ver
}

I have updated the sample project to latest gradle version (7.4.2), multi project using kotlin dsl: https://github.com/jmongard/Git.SemVersioning.Gradle.Actions-Example

ghost commented 2 years ago

Got it, thanks! Will give it a try!