conventional-changelog/conventional-changelog

release-notes-generator: group notes by multiple titles

danijelTxFusion opened this issue · 0 comments

I want to include "DEPRECATED" notes in my commits, in addition to "BREAKING CHANGE." I also do not want a major release to be triggered when the term "DEPRECATED" is present. Furthermore, I aim to categorize the notes in the changelog and release notes under the titles "DEPRECATED" and "BREAKING CHANGE." Here's an example of what I am trying to achieve:

feat: add `Client.CallContractL2` method 

DEPRECATED:  `Client.CallContract` has been deprecated in favor of `Client.CallContractL2`.
feat: change return type of the `SendTransaction` function 

BREAKING CHANGE:  Return type of the `SendTransaction` function has been changed from `[]byte` to `Transaction`.

I want the following changelog and release notes to be generated:

3.1.0 (2023-08-17)

Features

 - add `Client.CallContractL2` method  (<hash>)
 - change return type of the `SendTransaction` function  (<hash>)

BREAKING CHANGES

-  Return type of the `SendTransaction` function has been changed from `[]byte` to `Transaction`.

DEPRECATED

-  `Client.CallContract` has been deprecated in favor of `Client.CallContractL2`.

I read the documentation but I am still having trouble to achieve this. I tried to use the nodeGroupSort but it did not fix the problem because all notes are placed under BREAKABLE CHANGE section.

Here's the .releaserc that I am trying to make it work:

{
  "branches": "main",
  "debug": true,
  "addReleases": "top",
  "npmPublish": false,
  "plugins": [
    "@semantic-release/commit-analyzer",
    [
      "@semantic-release/release-notes-generator",
      {
        "parserOpts": {
          "noteKeywords": ["BREAKING CHANGE", "DEPRECATED"]
        },
        "writerOpts": {
           "noteGroupsSort": ["BREAKING CHANGE", "DEPRECATED"]
        }
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "CHANGELOG.md"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": ["CHANGELOG.md"],
        "message": "${nextRelease.version} CHANGELOG [skip ci]\n\n${nextRelease.notes}"
      }
    ],
    "@semantic-release/github"
  ]
}