-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Install cibuildwheel and build wheels
- Loading branch information
Showing
1 changed file
with
30 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,12 +192,41 @@ jobs: | |
ln -sf $(brew --prefix openssl)/lib/*a /usr/local/lib/ | ||
ln -sf $(brew --prefix openssl)/lib/*dylib /usr/local/lib/ | ||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install cibuildwheel | ||
python -m pip install delocate | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.cibw_build }} | ||
CIBW_ARCHS: ${{ matrix.cibw_archs }} | ||
CIBW_TEST_SKIP: "*-macosx_arm64" | ||
run: | | ||
export MACOSX_DEPLOYMENT_TARGET=12.0 | ||
export MACOS_DEPLOYMENT_TARGET=12.0 | ||
PREFIX=$(brew --prefix openssl) | ||
echo $PREFIX | ||
ls $PREFIX | ||
export CFLAGS="$CFLAGS -Wno-implicit-function-declaration -I$PREFIX/include" | ||
export CXXFLAGS="$CXXFLAGS -I$PREFIX/include" | ||
export LDFLAGS="$LDFLAGS -Wl,-S -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -lssl -lcrypto" | ||
export LIBRARY_PATH="$LIBRARY_PATH:$PREFIX/lib" | ||
DYLD_LIBRARY_PATH=$LIBRARY_PATH python -m cibuildwheel --output-dir wheelhouse | ||
echo "Target delocate archs: {delocate_archs}" | ||
ORIGINAL_WHEEL={wheel} | ||
ORIGINAL_WHEEL=$(ls wheelhouse/*whl) | ||
echo "Running delocate-listdeps to list linked original wheel dependencies" | ||
delocate-listdeps --all $ORIGINAL_WHEEL | ||
echo "Renaming .whl file when architecture is 'macosx_arm64'" | ||
RENAMED_WHEEL=${ORIGINAL_WHEEL//x86_64/arm64} | ||
echo "Wheel will be renamed to $RENAMED_WHEEL" | ||
mv $ORIGINAL_WHEEL $RENAMED_WHEEL | ||
echo "Running delocate-wheel command on $RENAMED_WHEEL" | ||
DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v $RENAMED_WHEEL | ||
echo "Running delocate-listdeps to list linked wheel dependencies" | ||
WHEEL_SIMPLE_FILENAME="${RENAMED_WHEEL##*/}" | ||
delocate-listdeps --all {dest_dir}/$WHEEL_SIMPLE_FILENAME | ||
echo "DONE." | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
|