From ea4454db1571428d3f30f05c9616f9f9b4701142 Mon Sep 17 00:00:00 2001 From: Yangyang Li Date: Mon, 30 Oct 2023 15:03:47 -0500 Subject: [PATCH] build: Update cibw_build options and delocate-wheel command --- .github/workflows/release.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fb4940d..ae42a013 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -159,11 +159,11 @@ jobs: name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" runs-on: ${{ matrix.os }} needs: ["release"] - if: needs.release.outputs.tag + # if: needs.release.outputs.tag strategy: matrix: os: [macos-latest] - cibw_build: ["cp38-*", "cp39-*"] + cibw_build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"] cibw_archs: ["arm64"] steps: @@ -180,17 +180,29 @@ jobs: uses: pypa/cibuildwheel@v2.16.2 env: CIBW_BUILD: ${{ matrix.cibw_build }} - CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs }} + CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_TEST_SKIP: "*-macosx_arm64" + CIBW_REPAIR_WHEEL_COMMAND: | + echo "Target delocate archs: {delocate_archs}" - - run: pip install wheel + ORIGINAL_WHEEL={wheel} - - name: Rename wheels - run: | - for cwheel in ./wheelhouse/*.whl; do - wheel tags --platform-tag macosx_12_0_arm64 $cwheel - rm $cwheel - done + 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" + 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: