From deb298537f120638fd8e9320b2b77d752d28bd17 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 1 Feb 2026 22:27:10 +0000 Subject: [PATCH] add ruff + publish actions --- .github/workflows/publish.yml | 53 +++++++++++++++++++++++++++++++++++ .github/workflows/ruff.yml | 19 +++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9ade358 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,53 @@ +name: Publish to PyPI + +on: + release: + types: [published] + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install Poetry + run: | + pip install poetry==2.3.1 + poetry --version + + - name: Build package + run: | + poetry install --only-root + poetry build + + - uses: actions/upload-artifact@v4 + with: + name: dist + path: ./dist + + pypi-publish: + needs: build + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/xair-api + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: ./dist + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: ./dist diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..4d71024 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,19 @@ +name: Ruff + +on: + push: + branches: [main] + + pull_request: + branches: [main] + + workflow_dispatch: + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v3 + with: + args: 'format --check --diff'