diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6801b05 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish to PyPI + +on: + release: + types: [published] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + pypi-publish: + name: Build and publish Python distribution to PyPI + runs-on: ubuntu-latest + + # MANDATORY: the workflow must have these permissions to authenticate with PyPI via OIDC + permissions: + id-token: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build a binary wheel and a source tarball + run: python -m build + + - name: Publish package distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1