diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7880be03..a95a5725 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -69,3 +69,53 @@ jobs: name: nyxus-wheels path: dist/*.whl retention-days: 1 + + + build_wheels_apple_arm64: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + MACOSX_DEPLOYMENT_TARGET: "11.0" + strategy: + matrix: + os: [macos-13-xlarge] + cibw_archs: ["arm64"] + cibw_build: ["cp39-*", "cp310-*", "cp311-*"] + + steps: + - uses: actions/checkout@v3 + name: Check out + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.11' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==2.16.2 delvewheel wheel + + - name: Building wheels + run: | + python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_BUILD_VERBOSITY: 3 + CIBW_ARCHS_MACOS: arm64 + CIBW_BEFORE_ALL_MACOS: brew install llvm@16 && + bash ci-utils/install_prereq_linux.sh --build_arrow yes && + mkdir -p /tmp/nyxus_bld && + cp -r local_install /tmp/nyxus_bld + + CIBW_ENVIRONMENT_MACOS: REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" ON_GITHUB="TRUE" PATH="/opt/homebrew/opt/llvm@16/bin:$PATH" COMPILER="/opt/homebrew/opt/llvm@16/bin/clang++" CFLAGS="-I /opt/homebrew/include -I/opt/homebrew/opt/llvm@16/include" CPPFLAGS="-I/opt/homebrew/opt/llvm@16/include" LDFLAGS="-L/opt/homebrew/opt/llvm@16/lib -L/opt/homebrew/opt/llvm@16/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@16/lib/c++" CXX="/opt/homebrew/opt/llvm@16/bin/clang++" CC="/opt/homebrew/opt/llvm@16/bin/clang" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} + CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio + CIBW_TEST_COMMAND: pytest {project}/tests/python + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: nyxus-wheels-apple-arm64 + path: dist/*.whl + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 77cff9bd..d6933784 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -67,6 +67,56 @@ jobs: - name: Install Dependencies run: python -m pip install --upgrade twine requests + - name: Publish to PyPi + run: python -m twine upload dist/*.whl + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} + TWINE_REPOSITORY: pypi + + + build_wheels_apple_arm64: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + MACOSX_DEPLOYMENT_TARGET: "11.0" + strategy: + matrix: + os: [macos-13-xlarge] + cibw_archs: ["arm64"] + cibw_build: ["cp39-*", "cp310-*", "cp311-*"] + + steps: + - uses: actions/checkout@v3 + name: Check out + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.11' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==2.16.2 delvewheel wheel + + - name: Building wheels + run: | + python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_BUILD_VERBOSITY: 3 + CIBW_ARCHS_MACOS: arm64 + CIBW_BEFORE_ALL_MACOS: brew install llvm@16 && + bash ci-utils/install_prereq_linux.sh --build_arrow yes && + mkdir -p /tmp/nyxus_bld && + cp -r local_install /tmp/nyxus_bld + + CIBW_ENVIRONMENT_MACOS: REPAIR_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64" ON_GITHUB="TRUE" PATH="/opt/homebrew/opt/llvm@16/bin:$PATH" COMPILER="/opt/homebrew/opt/llvm@16/bin/clang++" CFLAGS="-I /opt/homebrew/include -I/opt/homebrew/opt/llvm@16/include" CPPFLAGS="-I/opt/homebrew/opt/llvm@16/include" LDFLAGS="-L/opt/homebrew/opt/llvm@16/lib -L/opt/homebrew/opt/llvm@16/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@16/lib/c++" CXX="/opt/homebrew/opt/llvm@16/bin/clang++" CC="/opt/homebrew/opt/llvm@16/bin/clang" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" + CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} + CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio + CIBW_TEST_COMMAND: pytest {project}/tests/python + - name: Publish to PyPi run: python -m twine upload dist/*.whl env: diff --git a/ci-utils/install_prereq_linux.sh b/ci-utils/install_prereq_linux.sh index 20cc0044..9aa0a8e3 100755 --- a/ci-utils/install_prereq_linux.sh +++ b/ci-utils/install_prereq_linux.sh @@ -201,7 +201,15 @@ cd ../../ if [[ $BULD_DCMTK_DEP -eq 1 ]]; then curl -L https://github.com/DCMTK/dcmtk/archive/refs/tags/DCMTK-3.6.7.zip -o DCMTK-3.6.7.zip unzip DCMTK-3.6.7.zip - cd dcmtk-DCMTK-3.6.7 + cd dcmtk-DCMTK-3.6.7/CMake + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's/TIFF_LIBRARY/TIFF_LIBRARIES/' 3rdparty.cmake + sed -i '' 's/JPEG_LIBRARY/JPEG_LIBRARIES/' 3rdparty.cmake + else + sed -i 's/TIFF_LIBRARY/TIFF_LIBRARIES/' 3rdparty.cmake + sed -i 's/JPEG_LIBRARY/JPEG_LIBRARIES/' 3rdparty.cmake + fi + cd .. mkdir build_man cd build_man cmake -DCMAKE_INSTALL_PREFIX=../../"$LOCAL_INSTALL_DIR"/ -DCMAKE_PREFIX_PATH=../../"$LOCAL_INSTALL_DIR"/ -DDCMTK_WITH_ICONV=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_APPS=OFF ..