diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f844e4..846189b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,3 +88,32 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false verbose: true # optional (default = false) + + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pytest-bdd + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: test-run + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ +# - name: Publish package distributions to PyPI +# uses: pypa/gh-action-pypi-publish@release/v1