pmowrer / semantic-release-monorepo

Apply semantic-release's automatic publishing to a monorepo.
MIT License
510 stars 79 forks source link

Commit analyzation doesn't pick up any commits to release #131

Open szuperaz opened 1 year ago

szuperaz commented 1 year ago

Hi,

I'm using semantic-release@19.0.5 (tried with version 17 and 16 as well) and semantic-release-monorepo@7.0.5 with Yarn workspaces.

Here is my set up: Semantic release is configured for each package inside the monorepo. Given the following folder structure <repo root>/packages/<package-a> <repo root>/packages/<package-b>

I'm running semantic release inside <package-a> and <package-b>

The semantic release command finds the new commits, and even though I have commits with the correct message format and changes in the correct folders (<package-a> and <package-b>), the process doesn't find any relevant changes. Here are the logs from the "commit analyze" step (debug mode is turned on):

Screenshot 2022-10-12 at 16 38 15

Do you see something wrong with this setup?

amenella commented 1 year ago

Hi, I encoutered the same issue but found out that when using a custom config for semantic-release you should:

  1. extend it from semantic-release-monorepo
  2. add at least @semantic-release/commit-analyzer in the list of plugins (this is the one which will find the proper semver release)
  3. eventually, also add @semantic-release/release-notes-generator in the list of plugin

Here is a sample of a minimal custom configuration:

// release.config.js

module.exports = {
  repositoryUrl: '<your_repository_url>',
  extends: 'semantic-release-monorepo',
  branches: ['master'], // if you want to release on master
  plugins: [
    // "semantic-release-monorepo" is perfoming the analysis of commits (for the subrepo)
    // then update the context passed to `analyzeCommits` and `generateNotes` steps of semantic-release
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator", // not necessary to create a new release but useful for release's notes
  ],
};

It would be nice to indicate this in the doc of current repository.

jcapogna commented 1 year ago

I just ran into the same issue. What was not obvious is that I had to explicitly have @semantic-release/commit-analyzer as a plugin in my release config. I did not need that before.

As a side note, @semantic-release/commit-analyzer just moved to ESM which semantic-release-monorepo does not support yet, so you need to explicitly downgrade to v9 with npm install @semantic-release/commit-analyzer@9.

kpturner commented 7 months ago

As a side note, @semantic-release/commit-analyzer just moved to ESM which semantic-release-monorepo does not support yet, so you need to explicitly downgrade to v9 with npm install @semantic-release/commit-analyzer@9.

Did you try semantic-release-monorepo-esm ?