Skip to content

Commit

Permalink
feat: bring back bump-my-version. test with slightly different command.
Browse files Browse the repository at this point in the history
  • Loading branch information
drodarie committed Jul 25, 2024
1 parent 9d58ccf commit 3c52654
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ jobs:
token: ${{ github.token }}
branch: main

- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11

- name: Bump version in Python project
run: |
pip install --upgrade pip bump-my-version
oldv="${{ steps.semver.outputs.current }}"
newv="${{steps.semver.outputs.next}}"
# Replacing the __version__ in bsb/__init__.py, dropping the leading `v` with `${x:1}`
sed -i "s/__version__ =.*/__version__ = \"${newv:1}\"/g" test_actions/__init__.py
# Bump the version, dropping the leading `v` with `${x:1}`
bump-my-version replace --current-version=${oldv:1} --new-version=${newv:1} pyproject.toml
- name: Commit version change
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,27 @@ line-length = 100

[tool.isort]
profile = "black"

[tool.bumpversion]
current_version = "1.0.5"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = "--no-verify"

[tool.bumpversion.parts.pre_l]
values = ["dev", "a", "b", "rc", "final"]
optional_value = "final"

[[tool.bumpversion.files]]
filename = "test_actions/__init__.py"

0 comments on commit 3c52654

Please sign in to comment.