Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-releases such as 1.0.0-alpha1, 1.0.0-beta2, 1.0.0-rc5 #25

Open
Ocramius opened this issue Aug 2, 2020 · 3 comments
Open

Comments

@Ocramius
Copy link
Member

Ocramius commented Aug 2, 2020

Feature Request

See doctrine/automatic-releases#25

Currently the tool does not understand milestones named (\d+)\.(\d+)\.(\d+)\-(alpha|beta|rc)(\d*), nor knows how to sort them.

We want to support pre-release versions such as:

  • 1.0.0-alpha1
  • 1.0.0-beta32
  • 1.0.0-rc99

This requires expansion of the SemVerVersion value object, but should otherwise operate as usual. The only tricky part is sorting versions.

Q A
New Feature yes
RFC no
BC Break no
@boesing
Copy link
Member

boesing commented Aug 3, 2020

We might consider semver v2 in general.

Semver v2 allows the following regex:
https://github.com/phly/keep-a-changelog/pull/72/files#diff-04b5d0b4bded820269443348d382fbc1R17

@Ocramius
Copy link
Member Author

Ocramius commented Aug 3, 2020

@boesing
Copy link
Member

boesing commented Aug 8, 2020

Yeah, the class also says "use semver regex from semver.org" :-D

^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$

This provides a good prerelease information which supposed to be all we need to see if we have to mark a release as pre-release or not:
https://regex101.com/r/Ly7O1x/3/

The only thing is, how can we provide patches with that.
I've seen several *p1 releases in laminas (due to failed migration from zend):
laminas/laminas-diactoros@2.2.1...2.2.1p1
Is that something we want to match aswell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants