semantic-release
semantic-release copied to clipboard
maintainedVersion does not create a pre-release
Hi,
I have a .semrelrc file with the following content to create pre-releases for beta versions:
{
"maintainedVersion": "2-beta"
}
The beta release is created just fine, however I expected it to be a pre-release (in Github) which it is not. How can I make beta releases pre-releases, but not the releases on main?
Hey @Silthus, this is correct. The pre-release flag is always disabled by default.
You can either use the CLI flag --prerelease to enable pre-releases or you can add a provider config to you .semrelrc:
{
"maintainedVersion": "2-beta",
"plugins": {
"provider": {
"name": "github",
"options": {
"prerelease": true
}
}
}
}
Hey @Silthus, this is correct. The pre-release flag is always disabled by default.
You can either use the CLI flag
--prereleaseto enable pre-releases or you can add a provider config to you.semrelrc:{ "maintainedVersion": "2-beta", "plugins": { "provider": { "name": "github", "options": { "prerelease": true } } } }
Thank you for the quick answer. However one question remains: will this also affect the stable releases on the main branch? I only want to release pre-preleases on the beta branch.
If the .semrelrc only exists on the beta branch then it should work as expected.
But wouldn't it be better to have a branch specific configuration? Because this way I would need to delete or modify the config before a release merge into the mainline and always need to keep them diverged.
The node version of semantic-release does it like this:
.releaserc
{
"branches": [
"main",
{"name": "next", "prerelease": true }
]}
So maybe something like this? (just trying to think here if this would be a feature that makes sense):
{
"maintainedVersion": "2-beta",
"versionPlugins": {
"2-beta": {
"provider": {
"name": "github",
"options": {
"prerelease": true // override global configuration per maintained version?
}
}
}
"plugins": {
"provider": {
"name": "github",
"options": {
"prerelease": false
}
}
}
}