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

Release version not correlated to previous Prerelease version #788

Open
bencat-sixense opened this issue Feb 20, 2024 · 6 comments
Open

Comments

@bencat-sixense
Copy link

bencat-sixense commented Feb 20, 2024

I have a gitflow as follow:

  • PR merged on develop -> prerelease
  • develop merged on main -> release

When I create the prerelease version, I get this tag: my-project-name-0.5.0-dev.1
So if I merge this develop into main, I expect to get this: my-project-name-0.5.0
But I get this: my-project-name-0.4.2 (the previous release was my-project-name-0.4.1)

Do I miss something or is it the right behavior ?

This is my current project.json config:

    "release": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "noVerify": true,
        "postTargets": ["my-project-name:docker", "my-project-name:github"],
        "preset": "conventional",
        "push": true,
        "trackDeps": true
      }
    },
    "prerelease": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "noVerify": true,
        "postTargets": ["my-project-name:docker"],
        "preset": "conventional",
        "push": true,
        "preid": "dev",
        "releaseAs": "prerelease",
        "trackDeps": true,
        "skipCommit": true
      }
    },

NOTE: I use the latest v5.1.1 with Nx 16 and Node 18

Thank you !

@bencat-sixense
Copy link
Author

Anyone please ?

@edbzn
Copy link
Member

edbzn commented Feb 22, 2024

It's hard to know what's going on with git flow I cannot help you much but in your position I would look at the last generated tag and check if it's correctly pointing to your main branch, semver uses the last tag to calculate the next version.

@edbzn
Copy link
Member

edbzn commented Feb 22, 2024

It's hard to know what's going on with git flow I cannot help you much but in your position I would look at the last generated tag and check if it's correctly pointing to your main branch especially after you merged develop into main, semver uses the current tag to calculate the next version.

@kaankoken
Copy link

@edbzn I have a similar issue but it is not related to gitflow. you could check it out #817

@jhfrintrop
Copy link

I think the problem ist this commit: 7459d8b#diff-75b9477886013beac794751b9469c878ea7b9918d6c2abeaf46a9ebde40f81a6.

After that commit all prerelease tags are filtered out if releaseType isn't set.
And releaseType is releaseAs (https://github.com/jscutlery/semver/blob/main/packages/semver/src/executors/version/index.ts#L89), which means that prerelease tags are only considered if releaseAs is set, which means that you have to specify a fixed increment (major, minor, ...), which means semantic versioning is shut off.

@Cavayman
Copy link

Hey there, I’m facing an issue with semantic versioning on my current setup. I’m using semver 2.23.0 with Nx 14, and here’s what’s happening:

I have Tag v1.0.0
After that, I have two feature commits.
When I try to generate a prerelease, it gives me 1.0.1-beta (but I was expecting 1.1.0-beta).
If I generate without the prerelease, it correctly generates 1.1.0.
It seems like this issue might be fixed in a newer version (fingers crossed), but I can't update my versions at the moment.

Could someone help me figure this out?
Maybe @edbzn , you could advise me on what to do here?

Thanks a lot!

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

5 participants