Add ruff static analysis and a Gitea Actions release workflow
Release / release (push) Successful in 52s

Adds ruff (lint + format check) as a dev dependency and gate, applies its
fixes across the codebase (modernized typing, safer zip usage, line
length), and adds a Gitea Actions workflow that lints, tests, builds, and
publishes to the Gitea PyPI registry on v*.*.* tag pushes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 14:39:41 +02:00
co-authored by Claude Sonnet 5
parent 71921b5600
commit efc09e1a71
12 changed files with 104 additions and 59 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v4
- uses: https://github.com/actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: pip install ".[dev]" build twine
- name: Lint
run: ruff check .
- name: Format check
run: ruff format --check .
- run: pytest
- name: Set package version from the tag
run: sed -i "s/^__version__ = .*/__version__ = \"${GITHUB_REF_NAME#v}\"/" src/openrgb_hue/__init__.py
- name: Build sdist and wheel
run: python -m build
- name: Publish to Gitea PyPI registry
run: twine upload --repository-url https://dev.pivoine.art/api/packages/valknar/pypi dist/*
env:
TWINE_USERNAME: valknar
TWINE_PASSWORD: ${{ secrets.PACKAGE_TOKEN }}