From 16a9d29a4fb92d1f8e84279241d0dd15b5d7ec44 Mon Sep 17 00:00:00 2001 From: Omar <102324541+Ofahmy143@users.noreply.github.com> Date: Sun, 29 Sep 2024 19:01:32 +0300 Subject: [PATCH] feat: add release workflow Co-authored-by: Ghaith Kdimati " --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++ pyproject.toml | 53 +++++++++++++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..91e2228 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Semantic Release + +on: + push: + branches: + - release + +jobs: + release: + runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + export PATH="$HOME/.local/bin:$PATH" + + - name: Install dependencies + run: | + poetry install + + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@v9.8.8 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + push: true + directory: ./ diff --git a/pyproject.toml b/pyproject.toml index bba146a..fe5900c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "fastapi-rls" +name = "rls" version = "0.0.1" description = "fastapi sqlalchemy rls integration package" authors = [ @@ -38,8 +38,57 @@ pytest-xdist = "^3.6.1" requests = "^2.32.3" alembic = "^1.13.3" + + + +[tool.semantic_release] +branch= "release" +assets = [] +commit_message = "{version}\n\nNew Release" +commit_parser = "angular" +logging_use_named_masks = true +tag_format = "v{version}" +commit_version_number = true + +version_variable = [ + "src/tryceratops/__init__.py:__version__" +] +version_toml = [ + "pyproject.toml:tool.poetry.version", + "pyproject.toml:project.version" +] +version_pattern = [ + "README.md:rev: v{version}", + "docs/CONTRIBUTING.md:rls, version {version}" +] +major_on_zero = false +upload_to_PyPI = true +upload_to_release = true +build_command = "pip install poetry && poetry build" + + +[tool.semantic_release.branches.release-action] +match = "release" + + +[tool.semantic_release.commit_parser_options] +allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"] + +[tool.semantic_release.remote] +name = "origin" +type = "github" +ignore_token_for_push = false + +# [tool.semantic_release.publish] +# dist_glob_patterns = ["dist/*"] +# upload_to_vcs_release = true + + + [project] -name = "fastapi-rls" +name = "rls" version = "0.0.1" authors = [ { name = "DelfinaCare", email = "open-source@delfina.com" }