Skip to content

Commit 6e2aad2

Browse files
committed
fix: remove bump-my-version, use native uv version --bump instead
1 parent 9bcaf69 commit 6e2aad2

File tree

2 files changed

+34
-32
lines changed

2 files changed

+34
-32
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
1-
name: Publish to PyPI
1+
name: Bump Version and Publish to PyPI
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
workflow_dispatch:
5+
inputs:
6+
bump_type:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
715

816
jobs:
9-
release:
10-
name: Publish to PyPI
17+
bump-and-release:
18+
name: Bump Version and Publish to PyPI
1119
runs-on: ubuntu-latest
1220
environment: pypi
1321
permissions:
1422
id-token: write
23+
contents: write
1524
steps:
1625
- uses: actions/checkout@v4
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
1728

1829
- name: Install uv and setup Python
1930
uses: astral-sh/setup-uv@v3
2031

32+
- name: Bump version
33+
run: |
34+
uv version --bump ${{ inputs.bump_type }}
35+
NEW_VERSION=$(uv version --short)
36+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
37+
38+
- name: Commit version bump
39+
run: |
40+
git config --local user.email "action@github.com"
41+
git config --local user.name "GitHub Action"
42+
git add pyproject.toml uv.lock
43+
git commit -m "Bump version to ${{ env.NEW_VERSION }}"
44+
git tag "v${{ env.NEW_VERSION }}"
45+
git push origin master
46+
git push origin "v${{ env.NEW_VERSION }}"
47+
2148
- name: Build package
2249
run: uv build
2350

pyproject.toml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,5 @@ build-backend = "setuptools.build_meta"
5353
[tool.setuptools]
5454
py-modules = ["mcp_server_code_extractor"]
5555

56-
[tool.bumpversion]
57-
current_version = "0.1.1"
58-
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
59-
serialize = ["{major}.{minor}.{patch}"]
60-
search = "{current_version}"
61-
replace = "{new_version}"
62-
regex = false
63-
ignore_missing_version = false
64-
tag = true
65-
sign_tags = false
66-
tag_name = "v{new_version}"
67-
tag_message = "Bump version: {current_version} → {new_version}"
68-
allow_dirty = false
69-
commit = true
70-
message = "Bump version: {current_version} → {new_version}"
71-
pre_commit_hooks = ["uv sync", "git add uv.lock"]
72-
commit_args = ""
73-
74-
[[tool.bumpversion.files]]
75-
filename = "pyproject.toml"
76-
search = 'version = "{current_version}"'
77-
replace = 'version = "{new_version}"'
78-
7956
[dependency-groups]
80-
dev = [
81-
"bump-my-version>=1.2.0",
82-
]
57+
dev = []

0 commit comments

Comments
 (0)