1

We have a Java project with a JavaScript submodule, the structure looks like this:

java-project |- folder1 |- folder2 |- ... |- javascript-submodule |- package.json |- ...

Is it possible to set up semantic-release to track changes to javascript-submodule only and trigger the npm release of it using javascript-submodule/package.json?

Limon Monte
  • 52,539
  • 45
  • 182
  • 213

1 Answers1

3

You can use semantic-release in any directory, you just have to make to cd in that directory before running the semantic-release command.

However the concept of semantic-release is to analyze commits pushed since the last release. It seems you have 2 different projects in the same repo (the Java one and the Javascript one) so the commit analysis would be problematic as semantic-release will also trigger releases for commit that make changes only in the Java project. In addition semantic-release uses Git tags to identify commits associated with a release. So you will end up with tags like v1.0.0, v1.1.0 etc... that are relevant only for the Javascript project and might conflict with the manual releases you do for the Java project.

Probably the best solution in your case would be to use semantic-release to release both project at once: - Use the @semantic-release/exec plugin release the Java project - Use the @semantic-release/npm plugin to release the Javascript project with the option pkgRoot

In such configuration both the Java and the Javascript project would be released together with the same version, and the Git tags would apply to both.