Skip to content

update cibuild wheel #46

update cibuild wheel

update cibuild wheel #46

Workflow file for this run

name: Build
on: [push]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
REPO_DIR: 'dlib'
BUILD_COMMIT: 'v19.24.2'
DLIB_BIN_VERSION: '19.24.2'
CIBUILDWHEEL_VERSION: '2.17.0'
CIBW_BEFORE_BUILD: 'pip install cmake'
CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-* cp311-*'
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS: 'auto64'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout submodules
shell: bash
run: |
git submodule update --init --recursive
git -C dlib checkout $BUILD_COMMIT
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Fix setup.py
shell: bash
run: |
sed -i'' -e "s/name='dlib'/name='dlib-bin'/" $REPO_DIR/setup.py
sed -i'' -e "s/version=read_version_from_cmakelists('dlib\/CMakeLists.txt')/version='$DLIB_BIN_VERSION'/" $REPO_DIR/setup.py
sed -i'' -e "s/url='https:\/\/github\.com\/davisking\/dlib'/url='https:\/\/github\.com\/alesanfra\/dlib-wheels'/" $REPO_DIR/setup.py
sed -i'' -e "s/_cmake_extra_options = \[\]/_cmake_extra_options = \['-DDLIB_NO_GUI_SUPPORT=ON'\]/" $REPO_DIR/setup.py
- name: Install cibuildwheel
shell: bash
run: python -m pip install cibuildwheel==$CIBUILDWHEEL_VERSION
- name: Build wheels
shell: bash
run: python3 -m cibuildwheel $REPO_DIR --output-dir wheelhouse
- name: Save wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
# upload to PyPI on master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
skip_existing: true