How can I bump patch version? #64
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
When this action runs it first looks for the most recent version tag, once that is found all the commits since that tag are collected and evaluated to determine the next "version type".
This type is then used to increment the version exactly one increment forward. The increment count (which is not part of the version, but can be used to create a prerelease tag or as a build number in the four-number versions used sometimes like in .NET assembly versions) is set to the number of commits since the version changed. The intent here is the the developer making the change knows and is in the best position to indicate whether a change is breaking or not, and by indicating this in the commit the version can be determined correctly regardless of whatever other changes are included in a version. You should be able to do this with a merge commit message as well. Alternatively if you want to do something different you could fork and extend the providers, the |
Beta Was this translation helpful? Give feedback.
-
Hi @PaulHatch, sorry but I still can't get how to bump a I created a repo to check some cases, https://github.com/vitalii-dubovoy/version-bump that uses paulhatch/semantic-version@v4 action and I have tagged the main branch with I created a new branch, You mentioned:
I really can't get what is otherwise for the patch, if the Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hey @vitalii-dubovoy, no problem. What you need to do is mark the release. The next release after the tag will be incremented. If it isn't a major or minor release, it will be a "patch" type by default. Think of it in terms of being a customer/consumer of your project; as a customer if I'm on version 1.0.0 I'd expect it to go to 1.0.1, 1.1.0, or 2.0.0. If I see 1.0.2 I'm gonna think I missed a version. In general in most build systems incrementing on every build is trivial, but it creates these gaps whenever a version with more than one commit is released, so that's the purpose of this action. A lot of small projects do get released as a new version on every commit, so for those cases there's a "bump each commit option", but in general the idea is that the the version is only being updated after a release. There are currently two ways to make a release, one is to use a tag, which is the default. (I recommend this approach even if you aren't using this action, unless you specifically need to do something like support multiple versions simultaneously released/bug fixes on older versions.) In this mode the commit history is searched for a tag to find the last version, that tag does two things--first it provides the version to be incremented, second it identifies the starting commit for this version, commits after this will be checked to see if they are major or minor, and the total number of commits in the release is used to determine the increment value. The other mode does the same thing using branches, and is enabled by setting the In your example, the branch merge is doing nothing, tag version mode is enabled by default so it is looking for the tag and finds Also note that the version format is only setting the output version string, the version tag (or branch format) is a different thing, you can customize it by setting the prefix, namespace, or namespace separator. I recommend upgrading to version 5. The prerelease has been pretty stable so far, I'm just finishing a couple of open items before releasing, but I don't think there are any regressions. |
Beta Was this translation helpful? Give feedback.
-
@PaulHatch Hello, thank you for clarifying this |
Beta Was this translation helpful? Give feedback.
Hey @vitalii-dubovoy, no problem. What you need to do is mark the release. The next release after the tag will be incremented. If it isn't a major or minor release, it will be a "patch" type by default.
Think of it in terms of being a customer/consumer of your project; as a customer if I'm on version 1.0.0 I'd expect it to go to 1.0.1, 1.1.0, or 2.0.0. If I see 1.0.2 I'm gonna think I missed a version. In general in most build systems incrementing on every build is trivial, but it creates these gaps whenever a version with more than one commit is released, so that's the purpose of this action. A lot of small projects do get released as a new version on every commit, so for those cases the…