Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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@v1
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.11.2
env:
CIBW_SKIP: 'pp*'
CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_ARCHS_MACOS: "auto universal2"

- 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 twine

- name: Build sdist
run: |
python setup.py sdist

- name: Publish sdist to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*.tar.gz
python -m twine upload dist/*.tar.gz