diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 58731a4..c7d8845 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -54,19 +54,14 @@ jobs: runs-on: ubuntu-latest needs: build if: startsWith(github.ref, 'refs/tags/v') && success() + environment: + name: pypi + permissions: + id-token: write steps: - uses: actions/download-artifact@v3 with: name: dist path: dist - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - run: pip install twine - - - name: Publish PyPI package - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: twine upload dist/*.whl dist/*.tar.gz + - uses: pypa/gh-action-pypi-publish@release/v1