Release to PyPI #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release to PyPI | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-wheels: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Check out the release commit | |
| uses: actions/checkout@v3 | |
| - name: Set up QEMU | |
| uses: docker/[email protected] | |
| with: | |
| platforms: arm64 | |
| if: runner.os == 'Linux' | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python packages needed for wheel build and upload | |
| run: python -m pip install twine | |
| - name: Build wheels | |
| uses: pypa/[email protected] | |
| - name: Check and upload wheels | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| python -m twine check --strict wheelhouse/*.whl | |
| python -m twine upload wheelhouse/*.whl | |
| build-sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the release commit | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python packages needed for sdist build and upload | |
| run: python -m pip install build twine | |
| - name: Build sdist | |
| run: python -m build --sdist | |
| - name: Publish sdist to PyPI | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| python -m twine check --strict dist/* | |
| python -m twine upload dist/* |