on: release: types: - created jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup python uses: actions/setup-python@v4 with: python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install wheel - name: Build run: | python setup.py sdist bdist_wheel - name: Publish to PyPI if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' uses: pypa/gh-action-pypi-publish@release/v1.5 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}