From fbe577230228dd623640ac0752e04f9b26376e04 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 29 Mar 2026 00:24:53 +0000 Subject: [PATCH] chore: add semantic-release configuration - Configure version_toml for pyproject.toml - Configure version_variables for __init__.py - Set up Gitea remote for releases - Auto-update both files on release --- pyproject.toml | 28 ++++++++++++++++++++++++++++ src/kwork_api/__init__.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 72d578c..0bc27d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,3 +107,31 @@ exclude_lines = [ "raise NotImplementedError", "if TYPE_CHECKING:", ] + +# ========== Semantic Release ========== + +[tool.semantic_release] +version_toml = ["pyproject.toml:project.version"] +version_variables = ["src/kwork_api/__init__.py:__version__"] +branch = "main" +build_command = "uv build" +commit_parser = "angular" +tag_format = "v{version}" +major_on_zero = true +allow_zero_version = true + +[tool.semantic_release.commit_parser_options] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"] +breaking_change_tags = ["feat"] + +[tool.semantic_release.remote] +type = "gitea" +domain = "https://git.much-data.ru" +owner = "much-data" +repo_name = "kwork-api" +token = { env = "GH_TOKEN" } + +[tool.semantic_release.publish] +dist_glob_patterns = ["dist/*"] +upload_to_vcs_release = true diff --git a/src/kwork_api/__init__.py b/src/kwork_api/__init__.py index 4d2b799..c0af22a 100644 --- a/src/kwork_api/__init__.py +++ b/src/kwork_api/__init__.py @@ -28,7 +28,7 @@ from .models import ( ProjectsResponse, ) -__version__ = "0.1.0" +__version__ = "0.1.0" # Updated by semantic-release __all__ = [ "KworkClient", "KworkError",