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

EINVALIDNEXTVERSION (out of range) when releasing on maintenance branch #1642

Closed
alvarosabu opened this issue Sep 28, 2020 · 6 comments
Closed

Comments

@alvarosabu
Copy link

Hello, I'm having an issue on my library when trying to release a new feature or fixing a bug on the default 0.x branch (maintenance)

Current behavior

  • Default Branch 0.x
  • There is no master
  • next branch releases 1.x.x correctly when PR is open against it.

If I merge any feat, bugfix to 0.x I get the following error

[6:58:35 AM] [semantic-release] › ✖  EINVALIDNEXTVERSION The release `0.5.0` on branch `0.x` cannot be published as it is out of range.
Based on the releases published on other branches, only versions within the range >=1.0.0 <1.0.0 can be published from branch 0.x.

The following commits are responsible for the invalid release:

    * Merge pull request #111 from alvarosaburido/update-deps-nuxt-demo (6aecdfa)
    * feat(deps): update demo nuxt dependencies (4fba838)
    * Merge pull request #108 from alvarosaburido/update-rollup-deps (9b0b27a)
    * feat(deps): updated deps for. rollup (850460c)
    * Merge pull request #105 from alvarosaburido/migrate-0x-build-system-to-rollup (6e32d98)
    * feat(build): migrate build system to rollup 0.x (338c637)

Those commits should be moved to a valid branch with git merge (https://git-scm.com/docs/git-merge) or git cherry-pick (https://git-scm.com/docs/git-cherry-pick) and removed from branch 0.x with git revert (https://git-scm.com/docs/git-revert) or git reset (https://git-scm.com/docs/git-reset).

A valid branch could be next.

Expected behavior

  • Any PR against 0.x should trigger a 0.x release, example 0.5.0 in this case
  • Any PR against next should continue to trigger a 1.x release, example 1.3.0

Environment

"release": {
    "branches": [
      "0.x",
      "next"
    ]
  },

I'm not sure if it's something related to this repo itself or to the Github Action, please let me know to move it if necessary.

If you need any other log or info let me know.

Thank you very much in advance!

@travi
Copy link
Member

travi commented Sep 28, 2020

versions prior to v1.0.0 are not supported by semantic-release. please see this FAQ

@alvarosabu
Copy link
Author

@travi oh, I learned something new, didn't know about the 0.0.x limitation. Thanks for pointing me to the correct direction

Before closing the issue, what would happen if I add a breaking change on the main branch (previous 0.x) to force it to go to 1.x.x, next branch currently goes for 1.5.1. It would take the next 1.6.0 or directly a 2.x.x version?

@travi
Copy link
Member

travi commented Sep 28, 2020

this is a little bit of a unique situation because you'll be adding the v1.0.0 tag after your next branch was started, so i'm hesitant to suggest the exact behavior and end up being wrong. if you want to know the version that will be published before it actually happens, your best bet would be to use the --dry-run flag. also note that your update to the default branch wont be recognized until you merge (be sure not to rebase or otherwise rewrite history) into your next branch

@travi
Copy link
Member

travi commented Sep 28, 2020

also, since you've mentioned default branch names that are not master, please be aware of the current state of #1581

@alvarosabu
Copy link
Author

Thanks for the help @travi, sorry for the stack of questions haha,

your best bet would be to use the --dry-run flag. I should add this one to the .github/release.yml? If I understand correctly the docs it will show me what would be the next release version without actually publishing anything to npm.

@travi
Copy link
Member

travi commented Sep 28, 2020

I should add this one to the .github/release.yml?

you can add it to the cli command, wherever you are executing the semantic-release command.

If I understand correctly the docs it will show me what would be the next release version without actually publishing anything to npm.

correct

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