From 3b37a97b9eab3abf2ff4e5f216de94b109803537 Mon Sep 17 00:00:00 2001 From: Matte23 Date: Thu, 2 Apr 2026 11:59:04 +0200 Subject: [PATCH] ci: Add ci --- .gitea/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) 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/*