From 4e77e3fc4b493560cd5dd6327a3eb2294f8555b1 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Thu, 23 Jul 2026 14:33:15 +0200 Subject: [PATCH] Add Gitea Actions CI pipeline Three-stage workflow: lint/format/type-check (ruff, ty), pytest, and (master pushes only) a version-bump + uv build + publish to the Gitea package registry. Bump commit is tagged [skip ci] to avoid retriggering the workflow. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/ci.yml | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 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..297ef73 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + branches: [master] + +jobs: + lint: + name: Lint & type check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - run: uv sync --extra cpu --extra dev + - run: uv run ruff check . + - run: uv run ruff format --check . + - run: uv run ty check . + + test: + name: Tests + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - run: uv sync --extra cpu --extra dev + - run: uv run pytest + + build: + name: Bump version, build & publish wheel + needs: [lint, test] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.CI_TOKEN }} + - uses: astral-sh/setup-uv@v5 + - name: Bump patch version + run: | + git config user.name "gitea-actions" + git config user.email "actions@git.larsbogner.de" + uv version --bump patch --no-sync + NEW_VERSION=$(uv version --short) + git add pyproject.toml uv.lock + git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]" + git push + - run: uv build + - name: Publish to Gitea package registry + env: + TWINE_USERNAME: ${{ secrets.PACKAGE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.CI_TOKEN }} + run: uvx twine upload --repository-url https://git.larsbogner.de/api/packages/lars/pypi dist/*