on: [push, pull_request]
name: Python
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Build manylinux2010 wheels
if: matrix.os == 'ubuntu-latest'
run: |
docker run --rm -v `pwd`:/io -w /io quay.io/pypa/manylinux2014_x86_64 sh manylinux.sh
docker run --rm -v `pwd`:/io -w /io quay.io/pypa/manylinux2014_i686 sh manylinux.sh
ls -lrth dist/
- name: Build Non-Linux wheels
if: matrix.os != 'ubuntu-latest'
shell: bash
run: |
pip install wheel
python setup.py sdist bdist_wheel
ls -lrth dist/
- name: Publish Non-Linux package
if: matrix.os != 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
pip install twine
TWINE_USERNAME=__token__ TWINE_PASSWORD=${{ secrets.pypi_password }} twine upload --skip-existing dist/*
- name: Publish manylinux2010 package
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip-existing: true