Skip to content

Commit f5cfc47

Browse files
try win32
1 parent bdb4b25 commit f5cfc47

File tree

1 file changed

+96
-2
lines changed

1 file changed

+96
-2
lines changed

.github/workflows/build.yml

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,101 @@ jobs:
505505
with:
506506
name: wheel-windows-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
507507
path: dist/*
508-
508+
509+
build-windows32:
510+
# The type of runner that the job will run on
511+
runs-on: windows-2022
512+
strategy:
513+
# You can use PyPy versions in python-version.
514+
# For example, pypy2 and pypy3
515+
matrix:
516+
python-version: [ '3.12' ]
517+
raylib-platform: [ 'Desktop', 'SDL' ]
518+
steps:
519+
- uses: actions/checkout@v4
520+
with:
521+
submodules: recursive
522+
523+
- name: Download SDL2
524+
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-devel-2.32.10-VC.zip
525+
526+
- name: Create extraction directory
527+
run: mkdir ${{ runner.temp }}\SDL2
528+
529+
- name: Unzip SDL2
530+
run: tar -xf SDL2.zip -C ${{ runner.temp }}\SDL2 --strip-components=1
531+
532+
- name: Set SDL2_DIR environment variable
533+
run: echo SDL2_DIR=${{ runner.temp }}\SDL2\cmake >> $env:GITHUB_ENV
534+
535+
- name: Setup Python
536+
uses: actions/setup-python@v5
537+
with:
538+
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
539+
python-version: ${{ matrix.python-version }}
540+
# The target architecture (x86, x64) of the Python interpreter.
541+
architecture: x86
542+
543+
- name: Add msbuild to PATH
544+
uses: microsoft/setup-msbuild@v2
545+
with:
546+
msbuild-architecture: x86
547+
548+
- name: fix raygui bug
549+
run: |
550+
patch -p0 <raygui.h.diff
551+
shell: cmd
552+
553+
- name: Build raylib
554+
run: |
555+
cd raylib-c
556+
mkdir build
557+
cd build
558+
cmake -A Win32 -DPLATFORM=${{ matrix.raylib-platform }} -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
559+
msbuild raylib.sln /target:raylib /property:Configuration=Release
560+
copy raylib\Release\raylib.lib ..\..
561+
cd ..\..
562+
shell: cmd
563+
564+
- name: Build raylib-python-cffi
565+
env:
566+
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
567+
run: |
568+
copy ${{ runner.temp }}\SDL2\lib\x86\SDL2.lib .
569+
copy ${{ runner.temp }}\SDL2\lib\x86\SDL2.dll raylib\
570+
python -m pip install --upgrade pip
571+
pip3 install --upgrade "cffi"
572+
pip3 install --upgrade wheel
573+
pip3 install --upgrade setuptools
574+
pip3 install --upgrade build
575+
del raylib\dynamic\*.so* >nul 2>&1
576+
del raylib\dynamic\*.dll >nul 2>&1
577+
del raylib\dynamic\*.dylib >nul 2>&1
578+
del raylib\dynamic\32bit\* >nul 2>&1
579+
python -m build --wheel
580+
shell: cmd
581+
582+
- name: Test
583+
shell: bash
584+
run: |
585+
pip3 install --no-deps dist/*.whl
586+
cd /
587+
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
588+
cat /tmp/output
589+
if grep -q "INFO: Initializing raylib" /tmp/output; then
590+
echo "Passed"
591+
exit 0
592+
else
593+
echo "Failed"
594+
exit 1
595+
fi
596+
597+
- name: Upload build Artifact wheel
598+
uses: actions/upload-artifact@v4
599+
with:
600+
name: wheel-windows32-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
601+
path: dist/*
602+
509603
source-distro:
510604
runs-on: ubuntu-latest
511605

@@ -594,7 +688,7 @@ jobs:
594688
path: dynamic/dist/*
595689

596690
merge:
597-
needs: [build-mac-intel, build-mac-arm64, build-windows, build-linux, source-distro, dynamic-distro]
691+
needs: [build-mac-intel, build-mac-arm64, build-windows, build-linux, build-linux32, build-windows32, source-distro, dynamic-distro]
598692
runs-on: ubuntu-latest
599693
steps:
600694
- name: Merge All Artifacts

0 commit comments

Comments
 (0)