Skip to content

Commit 2cd7c52

Browse files
committed
release again
1 parent 113cabb commit 2cd7c52

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed

.bumpversion.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ search = version = "{current_version}"
88
replace = version = "{new_version}"
99

1010
[bumpversion:file:CHANGELOG.md]
11-
search = ## [Unreleased]
12-
replace = ## [Unreleased]\n\n## [{new_version}] - {now:%Y-%m-%d}
11+
search = ## [Unreleased]
12+
replace = ## [Unreleased]\\n\\n## [{new_version}] - {now:%Y-%m-%d}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9-
## [Unreleased]\n\n## [1.1.0] - 2024-10-15
9+
## [Unreleased]
1010

1111
### Fixed
1212

release.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,6 @@ def bump_version(bump_type):
2222
return new_version
2323

2424

25-
def delete_tag(tag):
26-
# Delete the local and remote tag if it exists
27-
print(f"Deleting existing tag {tag} locally and remotely...")
28-
subprocess.run(["git", "tag", "-d", tag], check=True)
29-
subprocess.run(["git", "push", "origin", f":refs/tags/{tag}"], check=True)
30-
31-
32-
def tag_exists_on_remote(tag):
33-
result = subprocess.run(
34-
["git", "ls-remote", "--tags", "origin", tag], capture_output=True, text=True
35-
)
36-
return bool(result.stdout.strip())
37-
38-
39-
def update_git(new_version: str, delete_existing_tag: bool = False):
40-
# Fetch tags to ensure the local repo is up to date
41-
subprocess.run(["git", "fetch", "--tags"], check=True)
42-
tag_name = f"v{new_version}"
43-
44-
if tag_exists_on_remote(tag_name):
45-
if delete_existing_tag:
46-
delete_tag(tag_name)
47-
else:
48-
print(f"Tag {tag_name} already exists on the remote. Aborting!")
49-
sys.exit(1)
50-
51-
subprocess.run(
52-
["git", "commit", "-am", f"Bump version to {new_version}"], check=True
53-
)
54-
55-
subprocess.run(
56-
["git", "tag", tag_name, "-m", f"Release v{new_version}"], check=True
57-
)
58-
subprocess.run(["git", "push", "origin", tag_name], check=True)
59-
60-
6125
def main():
6226
bump_type = "patch"
6327

@@ -69,9 +33,7 @@ def main():
6933

7034
# Bump the version
7135
new_version = bump_version(bump_type)
72-
73-
# Commit and tag the changes
74-
update_git(new_version)
36+
print(f"Bumped version to {new_version}")
7537

7638

7739
if __name__ == "__main__":

0 commit comments

Comments
 (0)