Need some help understand versionning

Hi,
When you go create a GitHub package, there is a small text explaining how to create version, a part of it is saying:

If the tag isn’t meant for production use, add a pre-release version after the version name. Some good pre-release versions might be v0.2-alpha or v5.9-beta.3.

Then there is a link to https://semver.org/ for people who want to read more
But on that link, at the element 9, it’s written the following:

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. […] Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes.

But the example given by GitHub (v0.2-alpha) have a leading 0 in it…
So I just wanted to know if I understood something and/or which way was the “correct” one

Thanks in advance,

Hi @xwilarg,

The way I read it is, the dot separated identifiers immediately following the patch version MUST NOT include leading zeroes. For example, you should avoid v5.9-beta.007. I don’t know if, v0.2-alpha-0.2 would count as containing a leading zeros? I suspect they are okay because they don’t contain extra zeros.

2 Likes

I guess I misunderstood that part, thanks for your answer!

1 Like