Skip to content

Commit

Permalink
✨ Manage UI releases
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed Jul 6, 2024
1 parent f292e6f commit 5c12739
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions laminci/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import importlib
import json
import os
import subprocess
from subprocess import PIPE, run
Expand Down Expand Up @@ -120,15 +121,20 @@ def main():
# cannot do the below as this wouldn't register immediate changes
# from importlib.metadata import version as get_version
# version = get_version(package_name)
module = importlib.import_module(package_name, package=".")
version = module.__version__
previous_version = get_last_version_from_tags()
validate_version(version)
if parse(version) <= parse(previous_version):
raise SystemExit(
f"Your version ({version}) should increment the previous version"
f" ({previous_version})"
)
if package_name is not None:
module = importlib.import_module(package_name, package=".")
version = module.__version__
previous_version = get_last_version_from_tags()
validate_version(version)
if parse(version) <= parse(previous_version):
raise SystemExit(
f"Your version ({version}) should increment the previous version"
f" ({previous_version})"
)
else:
previous_version = "?"
with open("ui/package.json", "r") as file:
version = json.load(file)["version"]

pypi = " & publish to PyPI" if args.pypi else ""
response = input(f"Bump {previous_version} to {version}{pypi}? (y/n)")
Expand Down

0 comments on commit 5c12739

Please sign in to comment.