diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index dddb2b6ff..203607d3d 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -8,24 +8,20 @@ on: types: [created] jobs: - deploy: - + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest - + environment: pypi-publish + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install build twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + - name: Build run: | python -m build - twine upload dist/* + # retrieve your distributions here + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1