jscutlery / semver

Nx plugin to automate semantic versioning and CHANGELOG generation.
MIT License
719 stars 83 forks source link

Release version not correlated to previous Prerelease version #788

Open bencat-sixense opened 4 months ago

bencat-sixense commented 4 months ago

I have a gitflow as follow:

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 commented 4 months ago

Anyone please ?

edbzn commented 4 months ago

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 commented 4 months ago

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 commented 1 month ago

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