Skip to content

Commit

Permalink
feat: add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
aleneum committed Dec 17, 2024
1 parent 8a5f48f commit 89af903
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import logging

from git import Remote, Repo

from hive_cli import __version__

_LOGGER = logging.getLogger(__name__)

repo = Repo()
if repo.is_dirty() or repo.untracked_files:
msg = "Repository is dirty, please commit or stash your changes"
raise ValueError(msg)
try:
origin: Remote = repo.remote("origin")
repo.create_tag(f"v{__version__}")
origin.push("origin", tags=True)
except ValueError as e:
_LOGGER.error("Errro: %s", e)

0 comments on commit 89af903

Please sign in to comment.