faac19edf3
CI / Lint & type check (push) Failing after 1m11s
CI / Tests (push) Has been skipped
CI / Lint & type check (pull_request) Failing after 59s
CI / Tests (pull_request) Has been skipped
CI / Bump version, build & publish wheel (push) Has been skipped
CI / Bump version, build & publish wheel (pull_request) Has been skipped
Unquoted on: gets parsed as the YAML 1.1 boolean true instead of the string "on", so Gitea couldn't find a trigger key and didn't register the workflow at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
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/*
|