Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maintainedVersion does not create a pre-release #144

Open
Silthus opened this issue Jul 12, 2022 · 4 comments
Open

maintainedVersion does not create a pre-release #144

Silthus opened this issue Jul 12, 2022 · 4 comments

Comments

@Silthus
Copy link

Silthus commented Jul 12, 2022

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?

@christophwitzko
Copy link
Member

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
      }
    }
  }
}

@Silthus
Copy link
Author

Silthus commented Jul 12, 2022

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
      }
    }
  }
}

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.

@christophwitzko
Copy link
Member

If the .semrelrc only exists on the beta branch then it should work as expected.

@Silthus
Copy link
Author

Silthus commented Jul 12, 2022

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
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants