node.jsdevopssemantic-release

Node.js semantic release is not properly taking the ranges for the hotfix branches


I have a hotfixes strategy to deploy from branches with the name as: N.N.x example: 0.30.x

I have next configuration of the semantic release:

 branches: [
     "main",
    "+([0-9])?(.{+([0-9]),x}).x",
   ],

When I deploy from the branch 0.30.x am getting an error:

'Based on the releases published on other branches, only versions within the range >=0.30.1 <0.30.1 can be published from branch 0.30.x.\n' +

Any ideas what is wrong and how to configure ranges for maintanance branches correctly?

"semantic-release": "24.2.3"

Solution

  • What is/was your latest release version?

    Maintenance branches can't publish releases with higher version numbers than your latest release, only release branches can do that.

    To bypass this you could either release a new version from your release branch, which would allow you to create a maintenance release, or rename the branch to next so it's a release branch

    https://semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#maintenance-branches