What needs to be done?
The release workflow needs a new input parameter "Preliminary Release Qualifier", which is expected to match either "M[0-9]" or "RC[0-9]".
When set, the RELEASE_VERSION in step "Version" is suffixed by "-$QUALIFIER" and is_prerelease is set to true.
Before setting it is checked that the version is ending with patch version "0", otherwise the workflow must abort with error, because only ".0" versions can have a preliminary qualifier.
When the qualifier is set, "Set next development version" sets the version back to the one before.
Example 1
The version on the branch to be released is 2.1.0-SNAPSHOT. The entered qualifier is "M1".
Then the "Version" step sets the version to 2.1.0-M1, commits the changed files, performs the release. The release is marked as preliminary release.
In the post_release job, the version is set _back to 2.1.0-SNAPSHOT_.
Example 2
The version on the branch to be released is 2.1.1-SNAPSHOT. The entered qualifier is "M1".
Then the release job is aborted, because a preliminary release qualifier cannot be assigned to a patch version.
Example 3
The version on the branch to be released is 2.1.0-SNAPSHOT. The entered qualifier is empty.
Then the "Version" step sets the version to 2.1.0, commits the changed files, performs the release. The release is marked as final release.
In the post_release job, the version is incremented to 2.1.1-SNAPSHOT_.
Additional context
With release 2.0.0 we have failed to release a preliminary milestone release. It was supposed to be released version 2.0.0-M3, but since the version on the release branch was 2.0.0-SNAPSHOT, the SNAPSHOT qualifier was just removed and 2.0.0 was accidentially released.
We had changed the version on the release branch not to include "-M3" already, because we are publishing snapshots to Maven Central without milestone suffix.
What needs to be done?
The release workflow needs a new input parameter "Preliminary Release Qualifier", which is expected to match either "M[0-9]" or "RC[0-9]".
When set, the RELEASE_VERSION in step "Version" is suffixed by "-$QUALIFIER" and is_prerelease is set to true.
Before setting it is checked that the version is ending with patch version "0", otherwise the workflow must abort with error, because only ".0" versions can have a preliminary qualifier.
When the qualifier is set, "Set next development version" sets the version back to the one before.
Example 1
The version on the branch to be released is
2.1.0-SNAPSHOT. The entered qualifier is "M1".Then the "Version" step sets the version to
2.1.0-M1, commits the changed files, performs the release. The release is marked as preliminary release.In the
post_releasejob, the version is set _back to2.1.0-SNAPSHOT_.Example 2
The version on the branch to be released is
2.1.1-SNAPSHOT. The entered qualifier is "M1".Then the release job is aborted, because a preliminary release qualifier cannot be assigned to a patch version.
Example 3
The version on the branch to be released is
2.1.0-SNAPSHOT. The entered qualifier is empty.Then the "Version" step sets the version to
2.1.0, commits the changed files, performs the release. The release is marked as final release.In the
post_releasejob, the version is incremented to2.1.1-SNAPSHOT_.Additional context
With release
2.0.0we have failed to release a preliminary milestone release. It was supposed to be released version2.0.0-M3, but since the version on the release branch was2.0.0-SNAPSHOT, theSNAPSHOTqualifier was just removed and2.0.0was accidentially released.We had changed the version on the release branch not to include "-M3" already, because we are publishing snapshots to Maven Central without milestone suffix.