Skip to content

Commit 16cf40c

Browse files
Allow version bumping tool to bump supported client (#343)
1 parent 9c57c99 commit 16cf40c

File tree

5 files changed

+46
-15
lines changed

5 files changed

+46
-15
lines changed

.bumpclient.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tool.bumpversion]
2+
current_version = "0.13.1"
3+
commit = true
4+
tag = false
5+
6+
[[tool.bumpversion.files]]
7+
filename = "src/murfey/__init__.py"
8+
search = '__supported_client_version__ = "{current_version}"'
9+
replace = '__supported_client_version__ = "{new_version}"'

.bumpversion.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.bumpversion.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[tool.bumpversion]
2+
current_version = "0.13.1"
3+
commit = true
4+
tag = true
5+
6+
[[tool.bumpversion.files]]
7+
filename = "src/murfey/__init__.py"
8+
search = '__version__ = "{current_version}"'
9+
replace = '__version__ = "{new_version}"'
10+
11+
[[tool.bumpversion.files]]
12+
filename = "pyproject.toml"
13+
search = 'version = "{current_version}"'
14+
replace = 'version = "{new_version}"'

.github/workflows/version-bump.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ on:
44
workflow_dispatch:
55
inputs:
66
bumpLevel:
7-
description: "Kind of version bump"
7+
description: "Kind of version bump for project"
88
required: true
99
default: "patch"
1010
type: choice
1111
options:
1212
- major
1313
- minor
1414
- patch
15+
- client
16+
bumpClient:
17+
description: "Bump supported client?"
18+
required: true
19+
type: boolean
20+
newClientVersion:
21+
description: "Version of new client (needed to bump supported client)"
22+
required: true
23+
default: "0.0.0"
24+
type: string
1525

1626
permissions:
1727
contents: read
@@ -45,13 +55,23 @@ jobs:
4555
4656
echo "##[section]Creating commit on branch 'version-bump'"
4757
git checkout -b version-bump
48-
bump2version ${{ inputs.bumpLevel }}
58+
59+
if [ ${{ inputs.clientBump } = true && ${{ inputs.newClientVersion }} != "0.0.0" ]; then
60+
bump-my-version bump --config-file .bumpclient.toml --new-version ${{ inputs.newClientVersion }}
61+
fi
62+
63+
if [&& ${{ inputs.bumpLevel }} != "client" ]
64+
bump-my-version bump ${{ inputs.bumpLevel }}
65+
fi
4966
5067
echo "##[section]Creating pull request"
5168
git push -f --set-upstream origin version-bump
5269
gh pr create -B main -H version-bump -t "Version update (${{ inputs.bumpLevel }})" -b "
5370
This is an automated pull request to update the version.
5471
72+
Bumped supported client client version: ${{ inputs.bumpClient }}
73+
If true, the supported client version is now: ${{ inputs.newClientVersion }}
74+
5575
After merging this, the \`Publish version\` action will tag this release and publish to pypi.
5676
"
5777
echo

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ client = [
4747
"xmltodict",
4848
]
4949
developer = [
50-
"bump2version", # Version control
50+
"bump-my-version<0.11.0", # Version control
5151
"ipykernel", # Enable interactive coding with VS Code and Jupyter Notebook
5252
"pre-commit", # Formatting, linting, type checking, etc.
5353
"pytest", # Test code functionality

0 commit comments

Comments
 (0)