Skip to content

Commit f4b9eab

Browse files
test mac build
1 parent d844bf0 commit f4b9eab

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,112 @@ jobs:
117117
path: dist/*
118118

119119

120+
build-mac-arm:
121+
runs-on: macos-13
122+
strategy:
123+
matrix:
124+
python-version: [ '3.12', '3.13', '3.14', 'pypy-3.11' ]
125+
raylib-platform: ['Desktop', 'SDL']
126+
env:
127+
MACOSX_DEPLOYMENT_TARGET: '11'
128+
steps:
129+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
130+
- uses: actions/checkout@v4
131+
with:
132+
submodules: recursive
133+
134+
- name: fix raygui bug
135+
run: |
136+
patch -p0 <raygui.h.diff
137+
138+
- name: Build SDL
139+
run: |
140+
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.8.tar.gz
141+
tar xvfz release-2.32.8.tar.gz
142+
mkdir build
143+
cd build
144+
cmake ../SDL-release-2.32.8 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
145+
cmake --build . --config Release
146+
sudo cmake --install .
147+
148+
- name: Setup Python
149+
uses: actions/setup-python@v5
150+
with:
151+
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
152+
python-version: ${{ matrix.python-version }}
153+
# The target architecture (x86, x64) of the Python interpreter.
154+
architecture: arm64
155+
156+
# Runs a set of commands using the runners shell
157+
- name: Build raylib without SDL because SDL version has incorrect pkg-config
158+
run: |
159+
cd raylib-c
160+
mkdir build
161+
cd build
162+
cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
163+
make -j2
164+
sudo make install
165+
166+
- name: Build raylib with SDL if selected
167+
run: |
168+
cd raylib-c
169+
mkdir build2
170+
cd build2
171+
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
172+
make -j2
173+
sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
174+
175+
- name: Copy extras
176+
run: |
177+
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
178+
sudo cp physac/src/physac.h /usr/local/include/
179+
sudo cp raygui/src/raygui.h /usr/local/include/
180+
181+
- name: Build raylib-python-cffi
182+
env:
183+
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
184+
185+
run: |
186+
python -m pip install --upgrade pip
187+
pip3 install --upgrade "cffi>=2.0.0"
188+
pip3 install --upgrade wheel
189+
pip3 install --upgrade setuptools
190+
python -m pip install --upgrade build
191+
python -m build --wheel
192+
193+
# - name: Rename wheels from universal2 to x86_64
194+
# run: |
195+
# # Rename universal2 wheels to x86_64 since they aren't truly universal
196+
# for wheel in dist/*universal2.whl; do
197+
# if [ -f "$wheel" ]; then
198+
# new_wheel=$(echo "$wheel" | sed 's/universal2/x86_64/')
199+
# echo "Renaming: $(basename "$wheel") -> $(basename "$new_wheel")"
200+
# mv "$wheel" "$new_wheel"
201+
# fi
202+
# done
203+
# shell: bash
204+
205+
- name: Test
206+
run: |
207+
pip3 install dist/*.whl
208+
cd /
209+
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
210+
cat /tmp/output
211+
if grep -q "INFO: Initializing raylib" /tmp/output; then
212+
echo "Passed"
213+
exit 0
214+
else
215+
echo "Failed"
216+
exit 1
217+
fi
218+
219+
- name: Upload build Artifact wheel
220+
uses: actions/upload-artifact@v4
221+
with:
222+
name: wheel-mac-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
223+
path: dist/*
224+
225+
120226

121227
build-linux:
122228
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)