|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build_wheels_x86: |
11 | | - name: Build x86_64 wheels |
| 10 | + build-x86_64: |
12 | 11 | runs-on: ubuntu-latest |
13 | | - timeout-minutes: 120 |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + python-version: ['3.10', '3.11', '3.12'] |
| 16 | + timeout-minutes: 60 |
14 | 17 |
|
15 | 18 | steps: |
16 | 19 | - name: Checkout repository |
17 | 20 | uses: actions/checkout@v4 |
18 | 21 |
|
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v5 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Install system dependencies |
| 28 | + run: | |
| 29 | + sudo apt-get update -qq |
| 30 | + sudo apt-get install -y --no-install-recommends \ |
| 31 | + build-essential cmake libboost-dev libopenblas-dev liblapack-dev \ |
| 32 | + libx11-dev libgtk-3-dev libjpeg-dev libpng-dev libtiff-dev \ |
| 33 | + libatlas-base-dev pkg-config |
| 34 | +
|
| 35 | + - name: Install Python build tools |
| 36 | + run: | |
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install build wheel setuptools auditwheel |
| 39 | +
|
19 | 40 | - name: Clone dlib |
20 | 41 | run: | |
21 | 42 | git clone --depth 1 https://github.com/davisking/dlib.git dlib_src |
22 | 43 |
|
23 | | - - name: Build x86_64 wheels |
24 | | - uses: pypa/cibuildwheel@v2.21.0 |
25 | | - with: |
26 | | - package-dir: dlib_src |
27 | | - env: |
28 | | - CIBW_BUILD: cp310-* cp311-* cp312-* |
29 | | - CIBW_ARCHS_LINUX: x86_64 |
30 | | - CIBW_BEFORE_ALL_LINUX: > |
31 | | - yum install -y cmake3 boost-devel openblas-devel lapack-devel |
32 | | - libX11-devel libpng-devel libjpeg-devel |
33 | | - libtiff-devel atlas-devel gcc gcc-c++ make git |
34 | | - CIBW_ENVIRONMENT: "CXXFLAGS='-O2 -g0'" |
| 44 | + - name: Build wheel |
| 45 | + run: | |
| 46 | + cd dlib_src |
| 47 | + python setup.py bdist_wheel |
35 | 48 | |
36 | | - - name: Upload x86_64 artifacts |
| 49 | + if [ ! -f dist/*.whl ]; then |
| 50 | + echo "Wheel build failed - no wheel found in dist/" |
| 51 | + ls -la dist/ || echo "dist/ directory not found" |
| 52 | + exit 1 |
| 53 | + fi |
| 54 | +
|
| 55 | + - name: Repair wheel (manylinux) |
| 56 | + run: | |
| 57 | + cd dlib_src |
| 58 | + mkdir -p dist_repaired/ |
| 59 | + auditwheel repair dist/*.whl -w dist_repaired/ || cp dist/*.whl dist_repaired/ |
| 60 | +
|
| 61 | + - name: Upload build artifact |
37 | 62 | uses: actions/upload-artifact@v4 |
38 | 63 | with: |
39 | | - name: wheels-x86_64 |
40 | | - path: ./wheelhouse/*.whl |
| 64 | + name: dlib-py${{ matrix.python-version }}-linux-x86_64 |
| 65 | + path: dlib_src/dist_repaired/*.whl |
41 | 66 | retention-days: 30 |
42 | 67 |
|
43 | 68 | release: |
44 | 69 | runs-on: ubuntu-latest |
45 | | - needs: [build_wheels_x86] |
| 70 | + needs: [build-x86_64] |
46 | 71 | if: startsWith(github.ref, 'refs/tags/') |
47 | 72 | permissions: |
48 | 73 | contents: write |
|
68 | 93 | Prebuilt dlib wheels for Linux x86_64 on Python 3.10, 3.11, and 3.12 |
69 | 94 | |
70 | 95 | **Installation:** |
71 | | - ```pip install dlib-*.whl``` |
| 96 | + ```pip install dlib-*.whl``` |
72 | 97 | Choose the wheel that matches your Python version (cp310, cp311, or cp312) |
73 | 98 | files: wheels/*.whl |
74 | 99 | draft: false |
|
0 commit comments