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

Provide prerelease option for version-resolver #614

Open
Happypig375 opened this issue Aug 4, 2020 · 6 comments
Open

Provide prerelease option for version-resolver #614

Happypig375 opened this issue Aug 4, 2020 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@Happypig375
Copy link
Contributor

With patch, the next version after 0.5.0-alpha would be 0.5.1.
However, with Semantic Versioning, the next resolved version should actually be 0.5.0.
Please add this option.

@jetersen
Copy link
Member

jetersen commented Aug 4, 2020

Not sure how you would achieve that within semver. I think their logic is correct after a prerelease the next version is an release.

inc(v, release): Return the version incremented by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if it's not valid
premajor in one call will bump the version up to the next major version and down to a prerelease of that major version. preminor, and prepatch work the same way.
If called from a non-prerelease version, the prerelease will work the same as prepatch. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it.

atm we are simply passing major, minor, or patch

@Happypig375
Copy link
Contributor Author

Should we allow all these options or just prerelease?

@Happypig375 Happypig375 changed the title Provide release option for version-resolver Provide prerelease option for version-resolver Aug 5, 2020
@afirth
Copy link

afirth commented Aug 21, 2020

I'm also wondering how to do this inside this tool.
Our workflow
master -> dev
0.1.1-rc1 -> int
0.1.1 -> production

I would like master commits to draft an RC, incrementing the RC number if a tag at the same major.minor.patch already exists.

@Nuru
Copy link

Nuru commented Sep 7, 2020

I would like to see a combined prerelease/release candidate option. This could be done as an extension to version-resolver. Add another set of labels that indicate release candidate. Logic something like this:

This PR has a release candidate tag:

  • Mark the release as a prerelease
  • Was the previous release a semver ending with -rc\d+?
    • yes: take the previous release tag, increment the number after -rc, use that for the new release tag
    • no: compute the next release version according to the other tags, append -rc1 to it, use that for the release tag

This PR does not have a release candidate tag:

  • Was the previous release a semver ending with -rc\d+?
    • yes: take the previous release tag, remove -rc and everything after it, use that for the new release tag
    • no: compute the next release version according to the other tags

@brian-pickens
Copy link

Throwing my hat in the ring here for this feature.

@neilime
Copy link
Contributor

neilime commented Jun 18, 2023

I've made a pull request for this: #1303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants