6

Here is the package I'm working on currently.

This is the first time I'm trying to enforce the conventional changelog format and use semantic release versioning. The releasing itself works fine, I'm having travis CI testing, building and publishing the package to npm, creating a new version and a git tag. There is also a GitHub package release created, which is, in a way, a replacement for a separate changelog file.

What I'm trying to achieve next is to automatically generate the ChangeLog based on the latest release changes. From what I understand conventional-changelog can help with that, but whenever I run:

$ conventional-changelog -p eslint-plugin-protractor -i CHANGELOG.md -w -r 0

I'm getting all the changes grouped under the 0.0.0-semantically-released version, which is the stub version I put into the package.json to avoid warnings during npm install.

What am I doing wrong and how can I generate logs for every semantic release version?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • 3
    Why don't your put the actual `version` in your package.json ? see [Recommanded workflow](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli#recommended-workflow) – Gabriel Bleu Jan 02 '18 at 13:36
  • @GabrielBleu I think the workflow was different back then, or I followed some other step-by-step instructions. I just remember there was a step to stub the `package.json` version. Thanks! Will try the recommended workflow. – alecxe Jan 06 '18 at 19:34

3 Answers3

3

It is working fine for me when I run the following command in your project folder:

conventional-changelog -p eslint-plugin-protractor -i CHANGELOG.md -s -r 0

I have added the contents of the generated CHANGELOG.md to a gist.

Maybe there was a bug with conventional-changelog when you opened this issue?

code
  • 2,115
  • 1
  • 22
  • 46
2

I think there is a semantic release plugin that does this, https://github.com/semantic-release/changelog, you'll need to add it to the release config in the publish step, or in the plugins array.

OAuthMan
  • 21
  • 2
1

As @OAuthMan mentioned, there is a semantic-release changelog plugin and the order of plugin import is important too. Plugins will be executed in the order they are defined during the release step. This order will generate the changelog for you

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
    "@semantic-release/git"
  ]
}
C-Dev
  • 425
  • 1
  • 6
  • 15