git icon indicating copy to clipboard operation
git copied to clipboard

Cannot update package.json

Open softshape opened this issue 2 years ago • 3 comments

Here's my .releaserc file which updates changelog.md on each build:

    [
    "@semantic-release/release-notes-generator", {
      "preset": "conventionalcommits"
      },
    ],
    [
      "@semantic-release/git",
      {
          "message": "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]

I want to update version number in package.json also. But as soon as I add it to the config:

      "@semantic-release/git",
      {
          "assets": ["package.json"],
          "message": "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }

it stops to update changelog.md (and doesn't update package.json anyway).

What is the correct way to update both changelog.md and package.json?

softshape avatar May 15 '22 04:05 softshape

Hey there, I think that the problem here it's missing semantic-release/npm plugin.

I suggest to check this answer.

pmarchini avatar May 30 '22 12:05 pmarchini

try to install @semantic-release/git

budarin avatar Jun 23 '22 19:06 budarin

Hello there,

I must say it's duplicate of this issue : https://github.com/semantic-release/semantic-release/issues/1593#issuecomment-656871587 The package.json's version of your project isn't committed because you're missing @semantic-release/npm in your configuration, you'll need to add it into your dependencies though. I agree, it's a little confusing because most of us thought it had to do with releasing a package in npmjs, which is not the case.

Hope the issue is resolved :+1:

Walidoux avatar Aug 31 '22 14:08 Walidoux