diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8fd2cd8..4b6e25d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -43,16 +43,16 @@ jobs: run: | python -m venv venv . ./venv/bin/activate - pip install --upgrade pip h5py setuptools wheel build + pip install -U twine cibuildwheel - - name: Install dependencies - run: | - sudo apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3 + - name: Build wheels + run: python -m cibuildwheel --output-dir dist + # to supply options, put them in 'env', like: + env: + CIBW_BEFORE_BUILD: ./build_wheel.sh - name: Publish to PyPI run: | - pip install -U twine cibuildwheel - python -m cibuildwheel . python -m twine upload --repository pypi --username __token__ --password ${{ secrets.PYPI }} dist/* env: PYPI: ${{ secrets.PYPI }} diff --git a/build_wheel.sh b/build_wheel.sh new file mode 100755 index 0000000..cc0d89a --- /dev/null +++ b/build_wheel.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -ex # will exit on any error and print all commands + +yum install -y epel-release +yum update -y # Update the system +yum groupinstall -y "Development Tools" +yum install -y cmake3 git libusb-devel hdf5-devel + +# Clone and build LimeSuite +rm -rf LimeSuite +git clone https://github.com/myriadrf/LimeSuite.git +cd LimeSuite/build || exit +cmake3 ../ -DENABLE_GUI=OFF +make -j$(nproc) +make install +ldconfig \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8a10bb4..88c68a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,4 +52,13 @@ convention = "google" "Source Code" = "https://github.com/nqrduck/limedriverbindings" [tool.hatch.build.targets.wheel] -packages = ["src/limedriver"] \ No newline at end of file +packages = ["src/limedriver"] + +[tool.cibuildwheel] +manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64" +manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64" +manylinux-ppc64le-image = "quay.io/pypa/manylinux_2_28_ppc64le" +manylinux-s390x-image = "quay.io/pypa/manylinux_2_28_s390x" + +[tool.cibuildwheel.linux] +archs = ["aarch64", "x86_64", "ppc64le", "s390x"]