Skip to content

Release to PyPI

Release to PyPI #12

Workflow file for this run

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/setup-qemu-action@v2
with:
platforms: arm64
if: runner.os == 'Linux'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python packages needed for wheel build and upload
run: python -m pip install twine
- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
- name: Check and upload wheels
# 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.10'
- 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
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*
python -m twine upload dist/*