Skip to content

prerelease can't comply with the semver.org specification #150

Closed
@nweldev

Description

@nweldev

Commitizen only implements the normalized PEP-440 prerelease format, excluding separators between :

  • the release segment and the pre-release segment
  • the pre-release signifier and the numeral

Therefore, when using the bump command, we can't define a version format which complies with the one defined by the semver.org specification :

"pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version."

"Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92."

consequences

cz bump can't be used for prereleases alongside tools that follow this specification.

Especially, this leads to an error when using the Node.js semver package.

Yet, this package is used by a bunch of other tools, like Github Automatic Release (see error message below) and conventional-changelog.

The parameter "automatic_release_tag" was not set and the current tag "v1.0.0rc1" does not appear to conform to semantic versioning.
(node:3557) UnhandledPromiseRejectionWarning: Error: The parameter "automatic_release_tag" was not set and the current tag "v1.0.0rc1" does not appear to conform to semantic versioning.
  at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:224465
  at Generator.next (<anonymous>)
  at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:221749
  at new Promise (<anonymous>)
  at n (/home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:221494)
  at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:224406
  at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:224971
  at Generator.next (<anonymous>)
  at /home/runner/work/_actions/marvinpinto/action-automatic-releases/latest/dist/index.js:1:221749
  at new Promise (<anonymous>)

details

When adding a hyphen between patch and release in the configuration, it appears in all version numbers, including not prerelease ones (e.g. v1.2.3- instead of v1.2.3).

tag_format = "v$minor.$major.$patch-$prerelease"

In addition, there doesn't seem to be any way to add a separator (dot) between the prerelease signifier and the numeral.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions