diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3ffc977..0a3b6ff 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -4,6 +4,9 @@ on: branches: - testing - main + release: + types: + - created jobs: build_wheels: name: Build wheels on ${{ matrix.os }} @@ -81,4 +84,23 @@ jobs: - uses: actions/upload-artifact@v3 with: path: wheelhouse/*.whl - name: python-package-distributions \ No newline at end of file + name: python-package-distributions + publish-to-pypi: + if: ${{ startsWith(github.ref, 'refs/tags/') }} + name: Publish Python dist to PyPI + needs: + - build_wheels + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pgserver # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1