name: Publish to PyPI on: release: types: [created] jobs: deploy: runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/pip-add permissions: id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install build - name: Run Pytest tests run: | pip install pytest pytest-cov pytest --cov --cov-report=xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - name: Build package run: python -m build - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1