From 0bdb817f26f773e1758674886302398c3687c9c4 Mon Sep 17 00:00:00 2001 From: Matte23 Date: Mon, 16 Mar 2026 14:19:04 +0100 Subject: [PATCH] ci: Add test and publish action --- .gitea/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..306a628 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m venv .venv + .venv/bin/pip install -e ".[dev]" -q + + - name: Run tests + run: .venv/bin/pytest tests/ -v + + publish: + runs-on: ubuntu-latest + needs: test + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Build package + run: | + pip install build -q + python -m build + + - name: Publish to Gitea package registry + env: + TWINE_USERNAME: ${{ github.repository_owner }} + TWINE_PASSWORD: ${{ secrets.GITEA_TOKEN }} + run: | + pip install twine -q + twine upload \ + --repository-url ${{ gitea.server_url }}/api/packages/${{ github.repository_owner }}/pypi \ + dist/* diff --git a/pyproject.toml b/pyproject.toml index a4dd344..a0e85b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ requires-python = ">=3.10" dependencies = ["mcp>=1.0"] [project.optional-dependencies] -dev = ["pytest", "pytest-asyncio", "anyio"] +dev = ["pytest", "pytest-asyncio", "anyio", "build", "twine"] [tool.setuptools.packages.find] where = ["src"]