Skip to content

Function to create a new pre-release or bump an existing one in one step #109

@alex42ree

Description

@alex42ree

We need a function that creates the next pre-release version regardless of the status of the last release.

Current behaviour for a NEW pre-release is providing the property "-PnewPreRelease". It does the following:
Current version 1.0.0 -> new pre-release is 1.0.1-RC.0
Current version 1.0.1-RC.0 -> new pre-release is 1.0.2-RC.0
It always creates a new pre-release even if the latest version is already a pre-release.

Current behavior for INCREASING an existing pre-release version with "-PbumpComponent=pre-release" property is:
Current version 1.0.0 -> ERROR, there is no existing pre-release (see below)
Current version 1.0.0-SNAPSHOT -> ERROR, there is no existing pre-release (see below)
Current version 1.0.0-RC.0 -> new pre-release is 1.0.1-RC.1

The bump function throws an error if there is no existing pre-release: „Cannot bump pre-release because the latest version is not a pre-release version. To create a new pre-release version, use newPreRelease instead“.

To create a new pre-release when the latest version is not a pre-release version or update a current pre-release version I would have to gather the latest version, check if it is a pre-release and then perform action accordingly. But this is something that the plugin could do in one step. Let’s say I had a property called „-PnewPreReleaseOrBumpPreRelease“, I would get the following behaviour:

Current version 1.0.0 -> pre-release is 1.0.1-RC.0
Current version 1.0.0-RC.0 -> pre-release is 1.0.0-RC.1
Current version 1.0.0-SNAPSHOT -> pre-release is 1.0.1-RC.0
Current version 1.0.0-RC.1 -> pre-release is 1.0.0-RC.2

Any thoughts?

I could create a pull request for this functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions