Skip to content

Commit

Permalink
Merge pull request #2 from berylliumsec/fixing_build
Browse files Browse the repository at this point in the history
adding bump version
  • Loading branch information
berylliumsec-handler authored Mar 19, 2024
2 parents 8046060 + eb86448 commit c7795cb
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import re
import sys

with open("setup.py", "r") as f:
content = f.read()

# Extract the current version
match = re.search(r'version="([\d.]+)b(\d+)"', content)
if match:
version = match.group(1)
beta_num = int(match.group(2))

new_beta_num = beta_num + 1
new_version = f"{version}b{new_beta_num}"

content = content.replace(
f'version="{version}b{beta_num}"', f'version="{new_version}"'
)

print("new version")
print(f"{new_version}")
with open("setup.py", "w") as f:
f.write(content)

# Output the new version for subsequent GitHub Actions steps
print(f"::set-output name=new_version::{new_version}")
new_version_file = "new_version.txt"
with open(new_version_file, "w") as f:
f.write(new_version)

print(f"::set-output name=new_version::{new_version}")
else:
print("Version pattern not found!")
sys.exit(1)

0 comments on commit c7795cb

Please sign in to comment.