Skip to content

Build_macOS_arm64

Build_macOS_arm64 #20

Workflow file for this run

name: Build_macOS_arm64
on: workflow_dispatch #[push, pull_request]
jobs:
build_macOS_arm64:
runs-on: macos-15
env:
_PYTHON_HOST_PLATFORM: "macosx-15.0-arm64"
ARCHFLAGS: "-arch arm64"
MACOSX_DEPLOYMENT_TARGET: "15.0"
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- name: Check architecture
run: uname -m && arch
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout gw submodule
run: |
git submodule init
git submodule update
cd gw
git checkout master
git branch
cd ../
- name: Install build dependencies
run: |
brew install fontconfig freetype glfw htslib jpeg-turbo libpng xz
brew install meson ninja
python -m pip install build wheel delocate meson-python cython
python -m pip install numpy pysam
- name: Build libgw
run: |
cd ./gw
make prep > /dev/null 2>&1
CPPFLAGS+="-I$(brew --prefix)/include" LDFLAGS+="-L$(brew --prefix)/lib" make shared -j3
cp libgw/*.* $(brew --prefix)/lib
cp libgw/libskia.a ../gwplot/
cp -rf libgw/GW $(brew --prefix)/include
cd ..
ls $(brew --prefix)/include/GW
ls -lh $(brew --prefix)/lib/libgw*
ls -lh $(brew --prefix)/lib/libskia.a
ls -lh ./gwplot
- name: Build wheel file
run: |
pip wheel . --wheel-dir dist --no-build-isolation -v
- name: Delocate wheel file
run: |
delocate-wheel --require-archs arm64 -w dist -v dist/*.whl
- name: Install and test wheel
run: |
mkdir -p test_env
cd test_env
cp ../dist/gwplot*.whl .
python -m wheel unpack gwplot*.whl --dest wheel_contents
echo "Unpacked wheel contents:"
ls -Ra wheel_contents
echo "Checking interface.so dependencies:"
otool -L wheel_contents/gwplot-*/gwplot/interface.*.so
echo "Checking libgw dependencies:"
otool -L wheel_contents/gwplot-*/gwplot/libgw.*dylib
PYTHON_VERSION=${{ matrix.python-version }}
PYTHON_VERSION_NO_DOT=$(echo $PYTHON_VERSION | tr -d '.')
python${PYTHON_VERSION} -m venv .venv
source .venv/bin/activate
python -m pip install *cp${PYTHON_VERSION_NO_DOT}*.whl
python -c "import gwplot"
- name: Archive wheel files
uses: actions/upload-artifact@v4
with:
name: wheels_macOS_arm64_py${{ matrix.python-version }}
path: dist/gwplot*.whl