Skip to content

Build Python wheels for MacOS-arm64 #10

Build Python wheels for MacOS-arm64

Build Python wheels for MacOS-arm64 #10

Workflow file for this run

name: Build Python wheels for MacOS-arm64
on:
workflow_dispatch
# push:
# branches: [ master ]
env:
PYTHONUTF8: 1
jobs:
build:
name: Wheel for python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'macos-14' ] # macos-arm64 only
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- name: Checkout project
uses: actions/checkout@v4
# see https://github.com/marketplace/actions/setup-miniconda
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
#miniforge-version: latest
miniconda-version: latest
activate-environment: build-env
python-version: ${{ matrix.python-version }}
channels: cadquery, conda-forge, defaults
- name: Remove temp files
shell: bash -l {0}
run: |
rm -rf -v ./build
rm -rf -v ./cadquery_ocp.egg-info
- name: Run dependencies setup
shell: bash -l {0}
run: |
echo 'Building wheel for Python ${{ matrix.python-version }}'
echo 'Conda Deps Setup'
CONDA_SUBDIR=osx-arm64 conda create --yes -n ocp-build-system -c cadquery -c conda-forge python=${{ matrix.python-version }} ocp=7.7.2.* vtk=9.2.* pip
conda run -n ocp-build-system conda config --env --set subdir osx-arm64
conda run -n ocp-build-system pip install build setuptools wheel requests delocate auditwheel delvewheel
- name: Run wheel build
shell: bash -l {0}
run: |
conda run --live-stream -n ocp-build-system python -m build --no-isolation --wheel
- name: Print info
shell: bash -l {0}
run: |
conda info
conda list --explicit
echo '${{ github.event_name }} ${{ github.ref }}'
- name: Test wheel
shell: bash -l {0}
run: |
conda deactivate
CONDA_SUBDIR=osx-arm64 conda create --yes -n cadquerytest python=${{ matrix.python-version }}
conda run -n cadquerytest conda config --env --set subdir osx-arm64
conda activate cadquerytest
python -m pip install dist/*.whl
python -c "import OCP;print('OCP imported successfully')"
# see https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cadquery-ocp-${{ matrix.os }}-cp${{ matrix.python-version }}
path: dist/*.whl