[release] Add the possibility to release pre-releases
It would be good to be able to build pre-releases, eg to test changes to our release-workflow.
@jkowalleck gave us this information to get us started:
For npmjs.org registry, anything not tagged as latest is going to be not auto-installed. For npmjs.org registry, version numbers like 1.2.3-alpha.0 are treated as prereleases. For dockerhub registry, version numbers like 1.2.3-alpha are treated as prereleases. And for github releases, there is a pre-release flag.
here are snippets of the process used in some of my projects
- https://github.com/CycloneDX/cyclonedx-javascript-library/blob/1e335d8bfa01a46df2b7eb6ce61e9d022f8060f7/.github/workflows/release.yml#L94
- https://github.com/CycloneDX/cyclonedx-javascript-library/blob/1e335d8bfa01a46df2b7eb6ce61e9d022f8060f7/.github/workflows/release.yml#L138-L142
and
- https://github.com/CycloneDX/cyclonedx-javascript-library/blob/1e335d8bfa01a46df2b7eb6ce61e9d022f8060f7/.github/workflows/release.yml#L189
you could probably implement something that analyses the version number and detects whether it contains -alpha||-beta||-rc - and in this case use a NPM tag that that isn't "latest", and sets the GH release a prerelease ...
like this detection
- https://github.com/CycloneDX/cyclonedx-php-composer/blob/dc6acc8b9b6651dce93c3122edcc4e3424df845c/.github/workflows/release.yml#L48-L53 for
- https://github.com/CycloneDX/cyclonedx-php-composer/blob/dc6acc8b9b6651dce93c3122edcc4e3424df845c/.github/workflows/release.yml#L64-L64
Awesome, thanks for all of that!
ah, and you would not trigger the rolling releases for such prereleases.