diff --git a/.github/workflows/push-to-pypi.yml b/.github/workflows/push-to-pypi.yml index ed71196a..363ab72c 100644 --- a/.github/workflows/push-to-pypi.yml +++ b/.github/workflows/push-to-pypi.yml @@ -4,9 +4,14 @@ on: jobs: deploy: + name: Upload release to PyPI runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/coc.py + permissions: + id-token: write steps: - - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: @@ -15,10 +20,8 @@ jobs: run: | python -m pip install --upgrade pip pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build run: | python setup.py sdist bdist_wheel - twine upload dist/* + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1