See More

name: Test and Publish on: [push, pull_request, workflow_dispatch] jobs: deploy: strategy: fail-fast: false matrix: os: ["ubuntu-latest", "macOS-latest", "windows-latest"] cp: ["cp37","cp38","cp39","cp310"] timeout-minutes: 30 runs-on: ${{ matrix.os }} name: ${{ matrix.os }} - ${{ matrix.cp }} steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 with: python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip wheel setuptools hatch pip install --upgrade twine - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v1 with: platforms: all - name: Build wheels uses: pypa/[email protected] env: CIBW_ARCHS_LINUX: auto aarch64 CIBW_BUILD: | ${{ matrix.cp }}-manylinux_x86_64 ${{ matrix.cp }}-manylinux_i686 ${{ matrix.cp }}-manylinux_aarch64 ${{ matrix.cp }}-win_amd64 ${{ matrix.cp }}-win32 ${{ matrix.cp }}-macosx_x86_64 CIBW_REPAIR_WHEEL_COMMAND: '' # Disable auditwheel CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: pytest -v -s {package}/tests - name: Rename Linux wheels to ManyLinux if: runner.os == 'Linux' uses: jannekem/run-python-script-action@v1 with: script: | import os wheeldir = "./wheelhouse" print(os.listdir(wheeldir)) for f in os.listdir(wheeldir): fp = os.path.join(wheeldir, f) print(fp,"->",fp.replace("linux", "manylinux2014")) os.rename(fp, fp.replace("linux", "manylinux2014")) - name: Publish to PyPI if: success() && github.event_name == 'push' && env.TWINE_PASSWORD != '' && github.ref == 'refs/heads/master' env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | twine upload ./wheelhouse/*.whl --skip-existing hatch build -t sdist twine upload ./dist/*.tar.gz --skip-existing