diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8e053847..4968caeb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,6 +80,7 @@ jobs: - name: Set dev version shell: bash run: | + export PR_NUMBER=$(gh pr view --json number -q .number || echo "") bump-my-version bump dev bumpversion/__init__.py --no-commit --no-configured-files -v - name: Package diff --git a/pyproject.toml b/pyproject.toml index e4ce5be5..46a9c681 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -213,15 +213,15 @@ commit_args = "--no-verify" tag = true tag_name = "{new_version}" allow_dirty = true -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\.(?Pdev)\\d+\\+[-_a-zA-Z0-9]+)?" +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\.(?Ppost)\\d+\\.dev\\d+)?" serialize = [ - "{major}.{minor}.{patch}.{dev}{distance_to_latest_tag}+{short_branch_name}", + "{major}.{minor}.{patch}.{dev}{$PR_NUMBER}.dev{distance_to_latest_tag}", "{major}.{minor}.{patch}" ] message = "Version updated from {current_version} to {new_version}" [tool.bumpversion.parts.dev] -values = ["release", "dev"] +values = ["release", "post"] [[tool.bumpversion.files]] filename = "bumpversion/__init__.py"