@@ -24,15 +24,15 @@ jobs:
2424 matrix :
2525 # make arm64 deps and x86_64 deps
2626 include :
27- - { macarch: arm64, os: macos-14 }
28- - { macarch: x86_64, os: macos-13 }
27+ - { macarch: arm64, os: macos-15 }
28+ - { macarch: x86_64, os: macos-15 }
2929
3030 steps :
31- - uses : actions/checkout@v5 .0.0
31+ - uses : actions/checkout@v6 .0.2
3232
3333 - name : Test for Mac Deps cache hit
3434 id : macdep-cache
35- uses : actions/cache@v4.3.0
35+ uses : actions/cache@v5.0.3
3636 with :
3737 path : ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
3838 # The hash of all files in buildconfig manylinux-build and macdependencies is
5151
5252 # Uncomment when you want to manually verify the deps by downloading them
5353 # - name: Upload Mac deps
54- # uses: actions/upload-artifact@v4
54+ # uses: actions/upload-artifact@v6
5555 # with:
5656 # name: pygame-mac-deps-${{ matrix.macarch }}
5757 # path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
@@ -64,21 +64,13 @@ jobs:
6464 fail-fast : false # if a particular matrix build fails, don't skip the rest
6565 matrix :
6666 include :
67- - { macarch: arm64, os: macos-14 }
68- - { macarch: x86_64, os: macos-13 }
67+ - { macarch: arm64, os: macos-15 }
68+ - { macarch: x86_64, os: macos-15 }
6969
7070 env :
7171 MAC_ARCH : ${{ matrix.macarch }}
7272
73- # Explicitly tell CIBW what the wheel arch deployment target should be
74- # There seems to be no better way to set this than this env
75- # We need this because our minimum is 10.11, different from default
76- # of 10.9 on x86s
77- # Related issue: https://github.com/pypa/cibuildwheel/issues/952
78- _PYTHON_HOST_PLATFORM : ${{ matrix.macarch == 'x86_64' && 'macosx-10.11-x86_64' || 'macosx-11.0-arm64'}}
79-
80- # Similarly, we need to tell CIBW that the wheel's linking steps
81- # should be for 10.11 on x86
73+ # We need to tell CIBW that the wheel's linking steps should be for 10.11 on x86
8274 MACOSX_DEPLOYMENT_TARGET : ${{ matrix.macarch == 'x86_64' && '10.11' || '11.0' }}
8375
8476 CIBW_ARCHS : ${{ matrix.macarch }}
@@ -96,32 +88,88 @@ jobs:
9688 CIBW_BEFORE_TEST : rm -rf ${{ github.workspace }}/pygame_mac_deps
9789
9890 steps :
99- - uses : actions/checkout@v5 .0.0
91+ - uses : actions/checkout@v6 .0.2
10092
10193 - name : pip cache
102- uses : actions/cache@v4.3.0
94+ uses : actions/cache@v5.0.3
10395 with :
10496 path : ~/Library/Caches/pip # This cache path is only right on mac
10597 key : pip-cache-${{ matrix.macarch }}-${{ matrix.os }}
10698
10799 - name : Fetch Mac deps
108100 id : macdep-cache
109- uses : actions/cache@v4.3.0
101+ uses : actions/cache@v5.0.3
110102 with :
111103 path : ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
112104 key : macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
113105 fail-on-cache-miss : true
114106
115107 - name : Install uv for speed
116- uses : astral-sh/setup-uv@v6
108+ uses : astral-sh/setup-uv@v7
117109 with :
118- version : " 0.8.3 "
110+ version : " 0.9.2 "
119111
120112 - name : Build and test wheels
121- uses : pypa/cibuildwheel@v3.2.0
113+ uses : pypa/cibuildwheel@v3.2.1
114+
115+ - uses : actions/upload-artifact@v6
116+ with :
117+ name : macos-partial-${{ matrix.macarch }}
118+ path : ./wheelhouse/*.whl
119+ compression-level : 0 # wheels are already zip files, no need for more compression
120+
121+ universal2 :
122+ needs : build
123+ runs-on : macos-15
124+ steps :
125+ - name : Download artifacts
126+ uses : actions/download-artifact@v7
127+ with :
128+ merge-multiple : true
129+
130+ # Here we iterate over all our arm wheels, and get the corresponding intel wheel
131+ # (matching version) and use delocate-merge to generate the final universal2
132+ # wheel.
133+ - name : Generate universal2 wheels
134+ run : |
135+ set -euo pipefail
136+ shopt -s nullglob
137+
138+ pipx install delocate==0.13.0
139+
140+ OUT_DIR="wheelhouse"
141+ mkdir -p "$OUT_DIR"
142+ for arm in *arm64.whl; do
143+ x86="$(ls "$(echo "$arm" | cut -d- -f1-4)"-macosx_*_x86_64.whl 2>/dev/null | head -n1 || true)"
144+ if [[ ! -f "$x86" ]]; then
145+ echo "Copying arm wheel as is (missing x86 component): $arm"
146+ mv "$arm" "$OUT_DIR"
147+ continue
148+ fi
149+ echo "Merging:"
150+ echo " ARM: $arm"
151+ echo " X86: $x86"
152+ delocate-merge "$arm" "$x86" -w "$OUT_DIR"
153+ rm "$x86"
154+ done
155+ for x86 in *x86_64.whl; do
156+ echo "Copying x86_64 wheel as is (missing arm component): $x86"
157+ mv "$x86" "$OUT_DIR"
158+ done
159+
160+ - name : Sanity check - install and test a single universal2 wheel
161+ env :
162+ # Pip now forces us to either make a venv or set this flag, so we will do
163+ # this
164+ PIP_BREAK_SYSTEM_PACKAGES : 1
165+ SDL_VIDEODRIVER : " dummy"
166+ SDL_AUDIODRIVER : " disk"
167+ run : |
168+ python3 -m pip install --no-index --find-links wheelhouse pygame-ce
169+ python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
122170
123- - uses : actions/upload-artifact@v4
171+ - uses : actions/upload-artifact@v6
124172 with :
125- name : pygame-wheels-macos-${{ matrix.macarch }}
173+ name : pygame-wheels-macos
126174 path : ./wheelhouse/*.whl
127175 compression-level : 0 # wheels are already zip files, no need for more compression
0 commit comments