Skip to content

Commit

Permalink
build: release should no longer happen until first conventional commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexogeny committed Jul 31, 2024
1 parent ace4785 commit b8c53b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ci/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def update_pyproject_toml(version):

def determine_next_version(last_version: str | None, commits: list[str]) -> str:
if not last_version:
return "v0.1.0"
last_version = "v0.1.0"

major, minor, patch = map(int, last_version.lstrip("v").split("."))
suffix = ""
Expand Down
11 changes: 8 additions & 3 deletions ci/determine_next_version.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import subprocess
import sys

from .common import (
from common import (
determine_next_version,
get_commits_since_last_version,
get_last_version,
update_pyproject_toml,
)


def quit(message):
print(message)
sys.exit(0)


def main():
last_version = get_last_version()
commits = get_commits_since_last_version(last_version)
next_version = determine_next_version(last_version, commits)
if next_version == "noop":
print("No conventional commits detected. Cya!")
return
quit("No conventional commits found. Cya!")

print(next_version)
update_pyproject_toml(next_version)
Expand Down
2 changes: 1 addition & 1 deletion ci/generate_release_notes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .common import get_commits_since_last_version, get_last_version
from common import get_commits_since_last_version, get_last_version


def categorize_commits(commits):
Expand Down

0 comments on commit b8c53b0

Please sign in to comment.