import os import sys try: import toml except ImportError: print( "You need to install `toml` to use this file. Run `pip install toml` and try again." ) sys.exit() os.system("git pull") data = toml.load(open("pyproject.toml")) version = data["project"]["version"].split(".") version[1] = str(int(version[1]) + 1) data["project"]["version"] = ".".join(version) version_num = version[1] targets = ["tasks", "shard"] for t in targets: tag = f"registry.nyeki.dev/payphone/payphone/{t}:v{version_num}" os.system(f"docker build --target {t} --tag {tag} .") os.system(f"docker push {tag}") tag = f"registry.nyeki.dev/payphone/payphone/{t}:latest" os.system(f"docker build --target {t} --tag {tag} .") os.system(f"docker push {tag}") toml.dump(data, open("pyproject.toml", "w")) os.system("git add pyproject.toml uv.lock") os.system(f"git commit -m 'chore: 🔖 Bump to version v{version}.'") os.system("git push")