From 744bc28c42d9ea50be83636ccd7470e5e5e0637a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Nov 2025 16:23:02 +0000 Subject: [PATCH] Add GitHub workflow for PyPI deployment - Triggers on published releases and manual dispatch - Uses Python 3.11 for building - Implements trusted publishing (OIDC) for secure PyPI authentication - Builds package using python-build - Publishes to PyPI using pypa/gh-action-pypi-publish --- .github/workflows/deploy.yml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..49244f5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: Deploy to PyPI + +on: + release: + types: [published] + workflow_dispatch: # Allow manual triggering + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/prefer + permissions: + id-token: write # Required for trusted publishing + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1