From 69a85451415025e936ea4041773ed2dff2533370 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Wed, 15 Jul 2026 15:34:08 +0800 Subject: [PATCH] ci: add GitHub Actions for checks and PyPI release PDM-based CI on 3.14 (ruff, basedpyright, pytest); tag publish without git-cliff. --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++ .github/workflows/python-publish.yml | 39 ++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100755 .github/workflows/python-publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f2fb15a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Install PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: "3.14" + + - name: Install dependencies + run: pdm sync --dev + + - name: Ruff check + run: pdm run ruff check --output-format=github . + + - name: Ruff format + run: pdm run ruff format --check . + + - name: basedpyright + run: pdm run basedpyright . + + - name: pytest + run: pdm run pytest diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100755 index 0000000..e9d459c --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +name: Release and Publish Python Package + +on: + push: + tags: + - "v*" + +permissions: + contents: write + id-token: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Install build + run: python -m pip install --upgrade pip build + + - name: Build package + run: python -m build --sdist --wheel --outdir dist/ . + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + + - name: Create GitHub release + uses: softprops/action-gh-release@v2 + with: + files: | + dist/* + generate_release_notes: true