Yet another gradle-semantic-release-plugin that invokes Gradle wrapper script to release.
To apply this semantic-release plugin, you need to fulfill the following preconditions:
- Your Gradle project should manage its version by
gradle.properties
(not bybuild.gradle
norbuild.gradle.kts
). - Your Gradle project should have an executable Gradle wrapper script at the project root directory.
- Your CI environment should run on Linux environment that can run
./gradlew
. - Your Gradle project should use Maven Publish Plugin, Legacy publishing, Gradle Artifactory Plugin, Gradle Nexus Publish Plugin, or Plugin Publishing Plugin to publish artifact.
Follow install guide and CI configuration guide described in the semantic-release official document.
To manage version of toolset, we recommend you to have a package.json
in your project root directory. Manage both of semantic-release
and its plugins as devDependencies
.
Refer the spotbugs-gradle-plugin project as a working example.
This plugin updates gradle.properties
to bump up project version. If you want to keep the version in this file updated, configure @semantic-release/git
to commit changes. You can configure your package.json
like below:
"release": {
"plugins": [
"gradle-semantic-release-plugin",
[
"@semantic-release/git",
{
"assets": [
"gradle.properties"
]
}
]
]
},
Users can specify an API key and secret by supplying the following environment variables:
GRADLE_PUBLISH_KEY=my-key
- This will get translated to
-Pgradle.publish.key=my-key
- This will get translated to
GRADLE_PUBLISH_SECRET=my-secret
- This will get translated to
-Pgradle.publish.secret=my-secret
- This will get translated to
Possible usage in build.gradle.kts
publishing {
repositories {
maven {
name = "OrgRepo"
url = uri("https://maven.pkg.github.com/org/repo")
credentials {
username = project.properties["gradle.publish.key"].toString()
password = project.properties["gradle.publish.secret"].toString()
}
}
}
}
How it's different with the @tschulte/gradle-semantic-release-plugin?
That is a Gradle plugin implemented by Java. It can use Gradle's feature and ecosystem. However, it emulates semantic-release
and cannot use other semantic-release plugin at the same time.
Our plugin is a semantic-release plugin. It can work with other plugin implemented on node.js, but it just invokes Gradle and cannot handle so complex requirements by own.
Copyright (c) 2019-2024 Kengo TODA