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

v Tags being ignored #165

Open
eldir opened this issue Jul 25, 2024 · 3 comments
Open

v Tags being ignored #165

eldir opened this issue Jul 25, 2024 · 3 comments

Comments

@eldir
Copy link

eldir commented Jul 25, 2024

v prefixed tags seem to be ignored:
Standard main/development branch setup, I've added version tags here in two places to test this and the version output for the last commit here is '0.7.46-alpha.135'
image

Workflow settings:

- name: Semantic versioning
        id: versioning
        uses: PaulHatch/[email protected]
        with:
          enable_prerelease_mode: true
          tag_prefix: "v"
          search_commit_body: true
          bump_each_commit: true
          major_pattern: "[MAJOR]"
          minor_pattern: "[MINOR]"
          version_format: "v${major}.${minor}.${patch}"

Workflow output for the above step:
image

@eldir
Copy link
Author

eldir commented Aug 5, 2024

I think I understand what was causing this. It seems like version tags like v0.1 are ignored but v0.1.0 does correctly increase the version. Does this have to do with having enable_prerelease_mode enabled?

@eldir
Copy link
Author

eldir commented Aug 5, 2024

What I don't understand however is why this would have cause a minor version bump the commit dev_build got auto versioned to v0.13.1
image

with these settings
image

@PaulHatch
Copy link
Owner

PaulHatch commented Aug 5, 2024

Using enable_prerelease_mode prevents the next suggested version from ever incrementing 0 -> 1. It does this by "demoting" major changes to minor and minor to patch. Patch changes are unaffected. It is designed for projects which are still at version 0 (so like basically half the code that runs in production :) to prevent them from being launched "accidentally".

When you tag a commit with a version tag, you override whatever was going on before. When using prerelease mode you can either assign a v1.0.0 tag when you're ready to release which will start you off at v1.0.1 suggested for the next commit or remove the setting and make sure you have a major type commit included. (I usually mark the commit that removes it as something like Remove prerelease mode to prepare for v1 release (MAJOR)).

We do not use partial tags like v1, v0.1 at all. It is a somewhat common practice to assign these to the latest applicable commit, so you'll have v1 and v1.23.7 pointing to the same commit and that wouldn't work as a stable reference point in any case.

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