I think that although this might work, it would be confusing. An experimental (alpha or beta) release is not the same thing as a release in draft state. I think 'draft' refers to the release process (we are preparing a release, and although we have a draft we haven't completed it yet), while 'experimental' refers to the content of the release (we did release it, but its content and functionality may not be fully validated).
Making the UC code be aware of the GitHub releases and consider their draft or final states also seems to be an undesirable coupling of so far independent mechanisms.
GitHub does allow marking releases as in draft state and also, as a separate concept, optionally marking them as 'pre-release', which in their words is a way "to notify users that the release is not ready for production and may be unstable".
I may be wrong, but still fail to see why the use of JEP-229 may not be compatible with the publication of experimental releases, that can be a) exposed in a separate update center as usual and b) marked as "Pre-release" when published on GitHub.
In my previous experiment I had tried adding "-beta" to the <version> in the pom file and that failed when archiving the artifacts because it was using <changelist> instead <version> when looking for them. I think that changing that code to use <version> (ie: not taking as granted that version == changelist) would be more appropriate, but as an alternative I tried this:
- Reverted the pom to declare <version>${changelist}</version>
- Added instead the beta qualifier to the changelist.format in maven.config (ie: -Dchangelist.format=%d.%s-beta )
- Forced a new release.
It also got published as a GitHub release using the same version identifier. However, since it wasn't declared as "pre-release", it showed there as "Latest", as a regular release.
I later manually fixed that through the web UI, but it would be nice that the jenkins-maven-cd-action also recognized 'beta' or 'alpha' qualifiers in the version identifier to take care of that, the same way it's done for the update center.
I think this would be easy to achieve by modifying its run.sh as follows:
gh api -X PATCH -F draft=false -F name=$version -F tag_name=$version /repos/$GITHUB_REPOSITORY/releases/$release
[[ $version = *alpha* || $version = *beta* ]] && isAlphaOrBeta=true || isAlphaOrBeta=false
gh api -X PATCH -F draft=false -F name=$version -F tag_name=$version -F prerelease=$isAlphaOrBeta /repos/$GITHUB_REPOSITORY/releases/$release
Does it make sense? It does seem simple and good enough for me, but I may be missing something.