From 4fa8d236064cb9abe667a18860e5521f04c5ec8c Mon Sep 17 00:00:00 2001 From: Oscar Moll Date: Tue, 23 Apr 2024 14:27:58 -0400 Subject: [PATCH] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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