autotag-dev/autotag

Support subsequent pre-releases

Opened this issue · 2 comments

This is somewhat related to #18

Our dev preview tags look like X.Y.Z-dev.A

Sometimes we tag multiple dev previews before releasing the final version. I guess the same could be true for alpha, beta, rc and other pre release methods.

I opened a separate PR for this, as it seems less trivial than #18

This would be really helpful.

I'm not sure why we only support a set of specific pre-release names, I don't think SemVer has any such restriction:

https://semver.org/#spec-item-9

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 comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92

If we removed the constraint that pre-release names must be one of a specific set and instead validate according to SemVer's rules above would that solve your use case? eg:

$ autotag -p dev
1.0.0-dev

$ autotag -p dev.A
1.0.0-dev.A