Search code examples
versioningsemantic-versioning

How should the version look when artifacts are relased?


I'm working on my project's versioning and I want to adopt the guidelines from here.

I just have one question that either I didn't get or the material didn't cover. How should the release version look?

My understanding is that having a pre-release label is for internal development, as well as the build metadata. When building the artifacts for a release version, should you strip all the labels and keeping only the version core, i.e.: major.minor.patch? What label could get into source control and which must never do?


Solution

  • In the spec, there are release and prerelease versions. A release version does not have zero for the major field or have a prerelease tag attached. You are free to do whatever you like with regards to build-meta.

    In the real world, a "release" is anything you've published, such that it is publicly available. So for internal use, do what you want, but for external use, follow the spec. In other words, you can release a prerelease version by publishing it.