Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Quality Checks
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
- name: Install Python from .python-version
|
||||
run: $HOME/.local/bin/uv python install
|
||||
|
||||
- name: Sync development dependencies
|
||||
run: $HOME/.local/bin/uv sync --group dev
|
||||
|
||||
- name: Run quality checks
|
||||
run: PATH="$HOME/.local/bin:$PATH" make ci-check
|
||||
|
||||
tests:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
- name: Install Python from .python-version
|
||||
run: $HOME/.local/bin/uv python install
|
||||
|
||||
- name: Sync development dependencies
|
||||
run: $HOME/.local/bin/uv sync --group dev
|
||||
|
||||
- name: Run tests
|
||||
run: PATH="$HOME/.local/bin:$PATH" make test
|
||||
|
||||
publish:
|
||||
name: Publish to Gitea Packages
|
||||
runs-on: ubuntu-latest
|
||||
needs: [quality, tests]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
- name: Install Python from .python-version
|
||||
run: $HOME/.local/bin/uv python install
|
||||
|
||||
- name: Sync development dependencies
|
||||
run: $HOME/.local/bin/uv sync --group dev
|
||||
|
||||
- name: Validate package registry configuration
|
||||
env:
|
||||
PYPI_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}
|
||||
PACKAGE_USERNAME: ${{ secrets.PACKAGE_USERNAME }}
|
||||
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
||||
run: |
|
||||
test -n "$PYPI_REPOSITORY_URL" || (echo "PYPI_REPOSITORY_URL secret is required" && exit 1)
|
||||
test -n "$PACKAGE_USERNAME" || (echo "PACKAGE_USERNAME secret is required" && exit 1)
|
||||
test -n "$PACKAGE_TOKEN" || (echo "PACKAGE_TOKEN secret is required" && exit 1)
|
||||
|
||||
- name: Build distribution
|
||||
run: PATH="$HOME/.local/bin:$PATH" make build
|
||||
|
||||
- name: Check built artifacts
|
||||
run: PATH="$HOME/.local/bin:$PATH" uv run --with twine twine check dist/*
|
||||
|
||||
- name: Publish to Gitea PyPI registry
|
||||
env:
|
||||
TWINE_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}
|
||||
TWINE_USERNAME: ${{ secrets.PACKAGE_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PACKAGE_TOKEN }}
|
||||
run: PATH="$HOME/.local/bin:$PATH" uv run --with twine twine upload dist/*
|
||||
Reference in New Issue
Block a user