update publishing script

This commit is contained in:
Aran-Fey
2024-04-20 14:29:26 +02:00
parent 1cb66f2c67
commit 9f73cbe7aa
2 changed files with 6 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
__version__ = "0.5.11"
__version__ = "0.5.12"
import logging

View File

@@ -1,5 +1,4 @@
import subprocess
import sys
from pathlib import Path
import requests
@@ -18,6 +17,10 @@ def main() -> None:
if process.stdout.strip("\n") != "dev":
revel.fatal("You must checkout the 'dev' branch")
# Make sure the version number got bumped
if rio.__version__ == get_latest_published_version():
revel.fatal("You forgot to increment the version number")
# Build the TS code
subprocess.run(["rye", "run", "build"], check=True)
@@ -25,14 +28,6 @@ def main() -> None:
if not tests_pass():
revel.fatal("The test don't pass")
# Make sure the version number got bumped
if rio.__version__ == get_latest_published_version():
choice = revel.select(
{choice: choice for choice in ("patch", "minor", "major")},
prompt="You forgot to increment the version number. Which part do you wish to bump?",
)
subprocess.run([sys.executable, "-m", "hatch", "version", choice])
# Merge dev into main and push
subprocess.run(["git", "fetch", ".", "dev:main"], check=True)
subprocess.run(["git", "push", "-u", "origin", "main"], check=True)
@@ -48,7 +43,7 @@ def get_latest_published_version() -> str:
def tests_pass() -> bool:
return subprocess.run(["rye", "test"], check=True) == 0
return subprocess.run(["rye", "test", "--", "-x"], check=True) == 0
main()