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