sv4git icon indicating copy to clipboard operation
sv4git copied to clipboard

Publishing pre-releases

Open quickstar opened this issue 1 year ago • 1 comments

Hey I thinking about migrating to sv4git, this looks very cool 🚀 I've used Semmantic Release in the past, but unfortunately it is very slow, due to the nature of node package restoration.

We've used a flow where we have a develop and a main branch. The commits merged into the develop branch generates beta releases like v1.0.3-beta.2. After testing the develop branch is merged into the main branch which then generates the appropriate v1.0.3 release.

See Publishing pre-releases for more information.

Is it somehow possible to configure such a scenario with sv4git?

quickstar avatar Mar 24 '23 15:03 quickstar

I was going to submit the same issue. This feature would be useful for my use case as well.

The Semantic Versioning spec allows for pre-release extension that includes dot-separated ASCII alphanumerics, numbers, and hyphens. It also describes how to compare two pre-release strings to determine which is "greater." Together, I think those would allow for straightforward parsing of existing pre-release versions, but how to automatically increment a pre-release version is less straightforward. Since they can include non-numeric characters, it's not as easy as setting an auto-increment bool. However, I think this could be done in a way that despite not allowing for all valid pre-release tags, it would allow for a predictable, increment-able tag that meets the semver spec.

The most straightforward way would be to have a separate command for generating pre-release tags, or a separate option in the git sv next-version and git sv tag commands that instead adds -%d to the tag and increments as necessary. There could also be an optional configuration setting for a prefix to the pre-release version, so that it appends -%s.%d instead. For a more "hands-off" way of adding pre-release tags, there could also be configuration settings that would specify a branch pattern or some other way of specifying when to generate the tags.

If any of these ideas sound reasonable, I'd be happy to discuss the design in more detail and help with the implementation.

pwlandoll avatar Mar 27 '23 14:03 pwlandoll