Build Wheels #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels | |
on: [workflow_dispatch] | |
jobs: | |
build_wheels: | |
name: Build wheels on for ${{matrix.python.cp}}-${{ matrix.buildplat.sys }} | |
runs-on: ${{ matrix.buildplat.runs_on }} | |
strategy: | |
matrix: | |
buildplat: | |
- { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } | |
- { runs_on: macos-12, sys: macosx, arch: x86_64, benv: "12.0" } | |
- { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } | |
python: | |
- { cp: "cp38", rel: "3.8" } | |
- { cp: "cp39", rel: "3.9" } | |
- { cp: "cp310", rel: "3.10" } | |
- { cp: "cp311", rel: "3.11" } | |
- { cp: "cp312", rel: "3.12" } | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel | |
- name: Build wheels (Linux) | |
if: ${{ runner.os != 'macOS' }} | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* | |
CIBW_ARCHS_LINUX: "x86_64" | |
CIBW_BEFORE_ALL_LINUX: > | |
if command -v apt-get; then | |
apt-get -y git libicu-dev libxml2-dev libxslt1-dev libbz2-dev zlib1g-dev autoconf automake autoconf-archive libtool autotools-dev gcc g++ make libboost-dev | |
elif command -v yum; then | |
yum install -y git libicu-devel libxml2-devel libxslt-devel zlib-devel bzip2-devel libtool autoconf-archive autoconf automake m4 wget boost-devel | |
#on CentOS 7 we also have libtar-devel which will be installed by build-deps.sh, on 8 they are missing and will be installed from source or otherwise | |
elif command -v apk; then | |
apk add build-base git autoconf-archive autoconf automake libtool bzip2-dev icu-dev libxml2-dev libexttextcat-dev libtool rsync boost-dev && | |
rsync -av --ignore-existing /usr/share/aclocal/*.m4 /usr/local/share/aclocal/ | |
fi && | |
./build-deps.sh | |
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 | |
CIBW_SKIP: "*-win* *-manylinux_i686 pp*" | |
- name: Build wheels (macOS) | |
if: ${{ runner.os == 'macOS' && runner.python == '3.12' }} | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* | |
CIBW_ARCHS: ${{ matrix.buildplat.arch }} | |
CIBW_ENVIRONMENT: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.buildplat.benv }}" | |
CIBW_BEFORE_ALL_MACOS: > | |
brew install boost boost-python3 icu4c && | |
brew tap fbkarsdorp/homebrew-lamachine && | |
brew install timbl | |
- uses: actions/upload-artifact@v4 | |
if: ${{ ! (runner.os == 'macOS' && runner.python != '3.12') }} | |
with: | |
name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} | |
path: ./wheelhouse/*.whl |