Support use case for bumping from a pre-release version to a normal one
Use Case
I use pre-release versions (as defined in Semantic Versioning) for the work-in-progress code.
Here's my version flow visualized:
flowchart TD
A(1.1.0) -->|1. Start the next work-in-progress version| B(1.2.0-pre)
B -->|Add features| B
B --> C{Major release?}
C -->|2a. Release next major version| D1(2.0.0)
C -->|2b. Release next minor version| D2(1.2.0)
D1 -->|3a. Start the next work-in-progress version| E1(2.1.0-pre)
D2 -->|3b. Start the next work-in-progress version| E2(1.3.0-pre)
Steps 1, 3a and 3b can be done with mix bump minor --pre pre.
Step 2a can be done with mix bump major.
My problem is that I couldn't find a way to implement step 2b with Versioce. The best I could achieve was mix bump minor, but that skips a whole minor version altogether: 1.2.0-pre -> 1.3.0.
According to Semantic Versioning a pre-release version comes before a normal one:
When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version:
Example:
1.0.0-alpha < 1.0.0.
Therefore a transition from 1.2.0-pre to 1.2.0 is technically a version bump.
It would be nice to be able to do this with Versioce without resorting to shell scripting.
I'd give it a try implementing this myself, but I need advice how would you like the CLI command for such a case to look like.
Hey :wave:
Thanks for opening an issue and using Versioce. Makes sense, will look into that
Currently you can achieve what you need with mix bump 1.2.0
Thank you for the tip. The thing is, it would still force me to use shell scripting to extract that 1.2.0 part from the current pre-release version.
While the rest of the cases can be handled with a single mix task invocation, for 2b I'd need to resort to something like this:
mix bump "$(mix bump.version | cut -d- -f1)"
It would be nice to have a single mix command to achieve the same result.