Replies: 1 comment
-
|
I think you will want to use environment variables as part of your version string. Here is a snippet that uses the PR number as part of its development version: [tool.bumpversion]
current_version = "1.0.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<dev>post)\\d+\\.dev\\d+)?"
serialize = [
"{major}.{minor}.{patch}.{dev}{$PR_NUMBER}.dev{distance_to_latest_tag}",
"{major}.{minor}.{patch}"
]
[tool.bumpversion.parts.dev]
values = ["release", "post"]In the GitHub action that bumps the version, you can use this bit of code to get the PR number: PR_NUMBER=$(gh pr view --json number -q .number || echo "")
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to create unique dev versions across branches. My idea would have been to attach the branch name to the version. I have explained in the following picture how I could imagine this.
With a script, I have created a workaround and can set the version
bump-my-version bump --new-version “v1.0-dev0-feat1”. Unfortunately, I cannot simply call bump-my-version bump pre_n and simply increase it tov1.0-dev1-feat1. Maybe someone has an idea how I can adjust my config so that this works?Beta Was this translation helpful? Give feedback.
All reactions