name: publish on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true jobs: build: name: Build a pure Python wheel and source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install build dependencies run: python -m pip install --upgrade build - name: Build run: python -m build - uses: actions/upload-artifact@v3 with: name: artifacts path: dist/* if-no-files-found: error publish: name: Publish release runs-on: ubuntu-latest needs: - build steps: - uses: actions/download-artifact@v3 with: name: artifacts path: dist - name: Push build artifacts to PyPI uses: pypa/gh-action-pypi-publish@v1.5.0 with: skip_existing: true user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}