diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 61f8fce1e..005c63e86 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,6 +52,56 @@ jobs: with: repository-url: https://test.pypi.org/legacy/ + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + needs: release + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/gentropy + 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 + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: release + if: github.ref != 'refs/heads/main' + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/gentropy + + 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 TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + documentation: needs: release runs-on: ubuntu-latest