Skip to content

Commit

Permalink
Do not push tags if creating the tags failed
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Dec 23, 2024
1 parent 09ffb07 commit acee21f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
print("Package `hatch` is required: pip install hatch")
sys.exit()

VERSION = subprocess.check_output(["hatch version"], shell=True).decode()
VERSION = subprocess.check_output(["hatch version"], shell=True).decode().strip()

if sys.argv[-1] == "bump":
os.system("hatch version patch")

elif sys.argv[-1] == "publish":

os.system("hatch publish")
os.system("rm -f dist/django_tables2-2.7.4*")

elif sys.argv[-1] == "tag":
os.system("hatch build")
os.system(f"git tag -a v{VERSION} -m 'tagging v{VERSION}'")
os.system("git push --tags && git push origin master")
tag_cmd = f"git tag -a v{VERSION} -m 'tagging v{VERSION}'"
if exitcode := os.system(tag_cmd):
print(f"Failed tagging with command: {tag_cmd}")
else:
os.system("git push --tags && git push origin master")

elif sys.argv[-1] == "screenshots":

Expand Down

0 comments on commit acee21f

Please sign in to comment.