Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gradle-semantic-release-plugin

KengoTODA45.4kMIT1.10.1TypeScript support: included

Automated release management for Gradle project

semantic-release, gradle

readme

A semantic-release plugin for Gradle project

Yet another gradle-semantic-release-plugin that invokes Gradle wrapper script to release.

Build npm Commitizen friendly semantic-release: angular

Precondition

To apply this semantic-release plugin, you need to fulfill the following preconditions:

  1. Your Gradle project should manage its version by gradle.properties (not by build.gradle nor build.gradle.kts).
  2. Your Gradle project should have an executable Gradle wrapper script at the project root directory.
  3. Your CI environment should run on Linux environment that can run ./gradlew.
  4. Your Gradle project should use Maven Publish Plugin, Legacy publishing, Gradle Artifactory Plugin, Gradle Nexus Publish Plugin, or Plugin Publishing Plugin to publish artifact.

Procedure to install

Install semantic-release

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.

Configure @semantic-release/git

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"
          ]
        }
      ]
    ]
  },

Gradle Properties

Publish Properties

Users can specify an API key and secret by supplying the following environment variables:

  1. GRADLE_PUBLISH_KEY=my-key
    • This will get translated to -Pgradle.publish.key=my-key
  2. GRADLE_PUBLISH_SECRET=my-secret
    • This will get translated to -Pgradle.publish.secret=my-secret

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()
          }
      }
  }
}

FAQ

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

changelog

1.10.1 (2024-09-12)

Bug Fixes

  • support semantic-release v24.1.1 (44e4c75)

1.10.0 (2024-09-04)

Features

  • support artifactory-plugin v5 (69242ed)

1.9.2 (2024-06-05)

Bug Fixes

  • support semantic-release v24 (7b23423)

1.9.1 (2024-01-20)

Bug Fixes

  • bump semantic-release from 22.0.12 to 23.0.0, and drop support for node v18 (#573) (562c628)

1.9.0 (2023-12-31)

Features

  • preserve comments in properties file (0bbb179), closes #569

1.8.0 (2023-11-19)

Features

1.7.7 (2023-08-04)

Bug Fixes

  • deps: bump split2 from 4.1.0 to 4.2.0 (6671186)

1.7.6 (2023-01-08)

Bug Fixes

  • bump up promisified-properties to 2.0.27 (aa339a0)

1.7.5 (2023-01-08)

Bug Fixes

  • support semantic-release v20 that requires Node v18 (b567057)

1.7.4 (2022-11-15)

Bug Fixes

  • deps: bump minimatch from 3.0.4 to 3.1.2 (5ab6c5b)

1.7.3 (2022-06-03)

Bug Fixes

  • deps: bump npm from 8.3.1 to 8.12.0 (f79bb45)
  • deps: bump semver-regex from 3.1.3 to 3.1.4 (4c80824)

1.7.2 (2022-03-24)

Bug Fixes

  • deps: bump minimist from 1.2.5 to 1.2.6 (504d855)

1.7.1 (2022-03-24)

Bug Fixes

  • deps: bump promisified-properties from 2.0.23 to 2.0.24 (53d97d5)

1.7.0 (2022-03-18)

Features

  • support Gradle Nexus Publish Plugin (4e85edc), closes #391

1.6.8 (2022-03-16)

Bug Fixes

1.6.7 (2022-03-09)

Bug Fixes

  • support Node.JS 16.14.0 or later (f0689d2)

1.6.6 (2022-03-02)

Bug Fixes

  • deps: bump promisified-properties from 2.0.22 to 2.0.23 (1039a16)

1.6.5 (2022-02-22)

Bug Fixes

  • deps: bump promisified-properties from 2.0.21 to 2.0.22 (798b11b)

1.6.4 (2022-01-28)

Bug Fixes

  • deps: bump promisified-properties from 2.0.20 to 2.0.21 (5d6437e)

1.6.3 (2022-01-27)

Bug Fixes

  • deps: bump node-fetch from 2.6.2 to 2.6.7 (40c945c)

1.6.2 (2022-01-01)

Bug Fixes

1.6.1 (2021-12-21)

Bug Fixes

  • deps: bump promisified-properties from 2.0.19 to 2.0.20 (957c96e)

1.6.0 (2021-11-13)

Features

1.5.1 (2021-10-26)

Bug Fixes

  • deps: bump split2 from 3.2.2 to 4.1.0 (505ef2b)

1.5.0 (2021-10-10)

Bug Fixes

  • check stderr for null (53ebd04)
  • task: set child process encoding to utf-8 (e3656e1)

Features

  • task: add error output to publish task (395fa98), closes #288

1.4.24 (2021-09-16)

Bug Fixes

  • accept running build with both plugin-publish and maven-publish (6556bb3)

1.4.23 (2021-07-07)

Bug Fixes

  • deps: bump promisified-properties from 2.0.18 to 2.0.19 (6eec755)

1.4.22 (2021-06-09)

Bug Fixes

  • deps: bump normalize-url from 6.0.0 to 6.0.1 (4d20de9)

1.4.21 (2021-06-08)

Bug Fixes

  • deps: bump trim-newlines from 3.0.0 to 3.0.1 (44c7b75)

1.4.20 (2021-06-08)

Bug Fixes

  • deps: bump glob-parent from 5.1.0 to 5.1.2 (ec8f6da)

1.4.19 (2021-05-10)

Bug Fixes

  • deps: bump lodash from 4.17.19 to 4.17.21 (34e3e4f)

1.4.18 (2021-05-10)

Bug Fixes

  • deps: bump promisified-properties from 2.0.17 to 2.0.18 (ce721d9)

1.4.17 (2021-04-23)

Bug Fixes

  • deps: bump promisified-properties from 2.0.16 to 2.0.17 (e55140d)

1.4.16 (2021-03-30)

Bug Fixes

  • deps: bump y18n from 4.0.0 to 4.0.1 (263afe8)

1.4.15 (2021-03-30)

Bug Fixes

  • deps: bump promisified-properties from 2.0.15 to 2.0.16 (e85942c)

1.4.14 (2021-01-11)

Bug Fixes

  • resolve (void 0) to pass the build (244a6d4)
  • deps: bump ini from 1.3.5 to 1.3.8 (9482667)
  • deps: bump promisified-properties from 2.0.12 to 2.0.13 (89d64dc)
  • deps: bump promisified-properties from 2.0.13 to 2.0.14 (38f06bf)
  • deps: bump promisified-properties from 2.0.14 to 2.0.15 (7e04a92)

1.4.13 (2020-11-19)

Bug Fixes

  • deps: bump promisified-properties from 2.0.11 to 2.0.12 (2f5a7ca)

1.4.12 (2020-11-02)

Bug Fixes

  • deps: bump promisified-properties from 2.0.10 to 2.0.11 (41f42b0)

1.4.11 (2020-10-19)

Bug Fixes

  • deps: bump promisified-properties from 2.0.9 to 2.0.10 (ccf0af4)

1.4.10 (2020-09-24)

Bug Fixes

  • deps: bump promisified-properties from 2.0.8 to 2.0.9 (5c8edac)

1.4.9 (2020-09-14)

Bug Fixes

  • deps: bump promisified-properties from 2.0.7 to 2.0.8 (2ec4360)

1.4.8 (2020-08-24)

Bug Fixes

  • deps: bump split2 from 3.2.1 to 3.2.2 (f856580)

1.4.7 (2020-08-18)

Bug Fixes

  • deps: bump split2 from 3.1.1 to 3.2.1 (150758d)

1.4.6 (2020-07-28)

Bug Fixes

  • deps: bump promisified-properties from 2.0.6 to 2.0.7 (51f76cc)

1.4.5 (2020-07-16)

Bug Fixes

  • deps: bump lodash from 4.17.15 to 4.17.19 (91a5592)

1.4.4 (2020-07-16)

Bug Fixes

  • deps: bump promisified-properties from 2.0.5 to 2.0.6 (93d2dd2)

1.4.3 (2020-07-10)

Bug Fixes

  • deps: bump promisified-properties from 2.0.4 to 2.0.5 (b0fffdf)

1.4.2 (2020-07-08)

Bug Fixes

  • deps: bump npm from 6.14.5 to 6.14.6 (688d13d)
  • deps: bump promisified-properties from 2.0.3 to 2.0.4 (6668d59)

1.4.1 (2020-02-26)

Bug Fixes

  • property value could not contain any colon (2526ad1)

1.4.0 (2020-02-16)

Features

  • replace properties with promisified-properties module (2f960d6)

1.3.1 (2020-01-02)

Bug Fixes

  • deps: [security] bump handlebars from 4.1.1 to 4.5.3 (84e738b)

1.3.0 (2020-01-02)

Bug Fixes

  • deps: [security] bump npm from 6.11.2 to 6.13.4 (66ae1a2)

Features

  • support project that has no gradle.properties (83fefe3)

1.2.1 (2019-10-15)

Bug Fixes

  • plugin-publish-plugin needs project property (c7cd7e2)

1.2.0 (2019-10-15)

Features

  • support plugin-publish-plugin (62428ea)

1.1.0 (2019-04-28)

Features

  • Add Artifactory plugin support (371eb81)

1.0.3 (2019-03-29)

Bug Fixes

1.0.2 (2019-03-25)

Bug Fixes

  • package.json: remove needless requirement for the version of node and yarn (9cc19eb)

1.0.1 (2019-03-22)

Bug Fixes

  • exported items should be a function, not set of functions (860d546)

1.0.0 (2019-03-22)

Bug Fixes

  • fix lint error (34d9ff6)
  • remove needless task for verify-release step (60eb7c4)

Features

  • add gradle handling logic (aeebf16)
  • implement prepare step (23c6a21)
  • implement task for publish step (fe03adf)
  • implement verifyConditions step (8b81626)
  • implement version confirmation (49ce25f)