@@ -10,65 +10,98 @@ permissions:
1010 id-token : write # Required for trusted publishing to PyPI
1111
1212jobs :
13- build :
14- name : Build package on macOS
13+ build-wheels :
14+ name : Build wheels on macOS for Python ${{ matrix.python-version }}
1515 runs-on : macos-26
16+ strategy :
17+ matrix :
18+ # Build wheels for all supported Python versions
19+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
20+ fail-fast : false
1621
1722 steps :
1823 - name : Checkout code
1924 uses : actions/checkout@v4
2025
21- - name : Set up Python
26+ - name : Set up Python ${{ matrix.python-version }}
2227 uses : actions/setup-python@v5
2328 with :
24- python-version : " 3.11 "
29+ python-version : ${{ matrix.python-version }}
2530
2631 - name : Check macOS version
2732 run : |
2833 echo "macOS version:"
2934 sw_vers
3035 echo "Architecture:"
3136 uname -m
37+ echo "Python version:"
38+ python --version
3239
33- - name : Install build dependencies
34- run : |
35- python -m pip install --upgrade pip
36- pip install build wheel setuptools Cython>=3.0.0
40+ - name : Install uv
41+ uses : astral-sh/setup-uv@v4
42+ with :
43+ enable-cache : true
3744
38- - name : Build package
45+ - name : Build wheel
46+ env :
47+ MACOSX_DEPLOYMENT_TARGET : " 26.0"
48+ ARCHFLAGS : " -arch arm64"
49+ _PYTHON_HOST_PLATFORM : " macosx-26.0-arm64"
3950 run : |
40- python -m build
51+ uv build --wheel
4152
42- - name : Check build artifacts
53+ - name : Verify wheel contents
4354 run : |
4455 echo "Build artifacts:"
4556 ls -lh dist/
4657 echo ""
47- echo "Verifying wheel contents:"
48- unzip -l dist/*.whl || true
58+ echo "Checking for dylib in wheel:"
59+ if unzip -l dist/*.whl | grep -q "libfoundation_models.dylib"; then
60+ echo "✓ libfoundation_models.dylib found in wheel"
61+ unzip -l dist/*.whl | grep -E "(dylib|\.so)"
62+ else
63+ echo "✗ ERROR: libfoundation_models.dylib NOT found in wheel!"
64+ echo "Full wheel contents:"
65+ unzip -l dist/*.whl
66+ exit 1
67+ fi
4968
50- - name : Upload build artifacts
69+ - name : Upload wheel
5170 uses : actions/upload-artifact@v4
5271 with :
53- name : python-package-distributions
54- path : dist/
72+ name : wheel-${{ matrix. python-version }}
73+ path : dist/*.whl
5574
5675 publish :
5776 name : Publish to PyPI
58- needs : build
77+ needs : [ build-wheels]
5978 runs-on : ubuntu-latest
6079
6180 steps :
62- - name : Download build artifacts
81+ - name : Download all artifacts
6382 uses : actions/download-artifact@v4
6483 with :
65- name : python-package-distributions
6684 path : dist/
85+ merge-multiple : true
6786
6887 - name : Verify artifacts
6988 run : |
7089 echo "Downloaded artifacts:"
7190 ls -lh dist/
91+ echo ""
92+ echo "Verifying each wheel contains dylib:"
93+ for wheel in dist/*.whl; do
94+ echo "Checking $wheel:"
95+ ls -lh "$wheel"
96+ if unzip -l "$wheel" | grep -q "libfoundation_models.dylib"; then
97+ echo " ✓ dylib present"
98+ else
99+ echo " ✗ ERROR: dylib missing in $wheel!"
100+ echo "Wheel contents:"
101+ unzip -l "$wheel"
102+ exit 1
103+ fi
104+ done
72105
73106 - name : Publish to PyPI
74107 uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments