Skip to content

Commit aa74be0

Browse files
Update build.yml
1 parent 5871ff4 commit aa74be0

1 file changed

Lines changed: 119 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 119 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ jobs:
500500
strategy:
501501
matrix:
502502
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14']
503-
raylib-platform: [ 'Desktop', 'SDL', 'DRM', 'SDL_SOFT' ]
503+
raylib-platform: [ 'Desktop', 'SDL', 'SDL_SOFT' ]
504504
steps:
505505
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
506506
- uses: actions/checkout@v4
@@ -619,6 +619,123 @@ jobs:
619619
path: wheelhouse/*
620620

621621

622+
build-linux-arm64-drm:
623+
runs-on: ubuntu-22.04-arm
624+
container:
625+
image: electronstudio/raspberrypi-os:${{ matrix.docker-tag }}
626+
options: --user root
627+
volumes:
628+
- /tmp:/__e/node20
629+
strategy:
630+
matrix:
631+
include:
632+
- python-version: '3.10'
633+
docker-tag: 'python3.10-bookworm'
634+
- python-version: '3.11'
635+
docker-tag: 'python3.11-bullseye'
636+
- python-version: '3.12'
637+
docker-tag: 'python3.12-bullseye'
638+
- python-version: '3.13'
639+
docker-tag: 'python3.13-bookworm'
640+
- python-version: '3.14'
641+
docker-tag: 'python3.14-bookworm'
642+
steps:
643+
- name: fix node
644+
run: |
645+
ln -s /usr/local/bin /__e/node20/bin
646+
647+
- name: update cmake
648+
run: |
649+
wget https://github.com/Kitware/CMake/releases/download/v3.31.10/cmake-3.31.10-linux-aarch64.tar.gz
650+
tar xvfz cmake-3.31.10-linux-aarch64.tar.gz
651+
cp -r cmake-3.31.10-linux-aarch64/* /usr/
652+
653+
- name: install libs
654+
run: |
655+
apt update
656+
apt -y install libdrm-dev libgbm-dev libegl-dev libgles2-mesa-dev libasound2-dev
657+
658+
- uses: actions/checkout@v2
659+
with:
660+
submodules: recursive
661+
662+
- name: fix raygui bug
663+
run: |
664+
patch -p0 <raygui.h.diff
665+
666+
- name: Build raylib
667+
run: |
668+
cd raylib-c
669+
mkdir build
670+
cd build
671+
cmake -DPLATFORM="DRM" -DOPENGL_VERSION="ES 2.0" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_BUSY_WAIT_LOOP=OFF -DSUPPORT_CUSTOM_FRAME_CONTROL=OFF -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
672+
make -j2
673+
make install
674+
675+
- name: Copy extras
676+
run: |
677+
cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
678+
cp physac/src/physac.h /usr/local/include/
679+
cp raygui/src/raygui.h /usr/local/include/
680+
681+
- name: Build raylib-python-cffi
682+
env:
683+
RAYLIB_PLATFORM: DRM
684+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
685+
run: |
686+
python3 -m pip install --upgrade pip
687+
python3 -m pip install --upgrade cffi
688+
python3 -m pip install --upgrade wheel
689+
python3 -m pip install --upgrade setuptools
690+
python3 -m pip install --upgrade build
691+
python3 -m build --wheel
692+
python3 -m pip install twine
693+
python3 -m pip install --upgrade auditwheel
694+
python3 -m pip install --upgrade patchelf
695+
python3 -m auditwheel repair dist/*.whl
696+
697+
- name: Rename wheel for testing
698+
run: |
699+
for wheel in wheelhouse/raylib*.whl; do
700+
if [ -f "$wheel" ]; then
701+
basename=$(basename "$wheel")
702+
if [[ $basename =~ ^([^-]+)-([^-]+.*)-[^-]+-[^-]+-[^-]+\.whl$ ]]; then
703+
package="${BASH_REMATCH[1]}"
704+
version="${BASH_REMATCH[2]}"
705+
new_name="${package}-${version}-py3-none-linux_aarch64.whl"
706+
echo "Renaming: $basename -> $new_name"
707+
cp "$wheel" "wheelhouse/$new_name"
708+
fi
709+
fi
710+
done
711+
shell: bash
712+
713+
- name: Test
714+
run: |
715+
python3 -m pip install --no-deps wheelhouse/*-py3-none-linux_aarch64.whl
716+
rm -f wheelhouse/*-py3-none-linux_aarch64.whl
717+
cd /
718+
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
719+
cat /tmp/output
720+
if grep -q "INFO: Initializing raylib" /tmp/output; then
721+
echo "Passed"
722+
else
723+
echo "Failed"
724+
exit 1
725+
fi
726+
727+
- name: Publish to PyPI
728+
if: ${{ inputs.publish_to_pypi == true }}
729+
run: |
730+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} wheelhouse/*.whl
731+
732+
- name: Upload build Artifact wheel
733+
uses: actions/upload-artifact@v4
734+
with:
735+
name: wheel-linux-arm64-DRM-${{ matrix.python-version }}
736+
path: wheelhouse/*
737+
738+
622739

623740
build-windows:
624741
# The type of runner that the job will run on
@@ -948,7 +1065,7 @@ jobs:
9481065
path: dynamic/dist/*
9491066

9501067
merge:
951-
needs: [build-mac-intel, build-mac-arm64, build-windows, build-linux, build-linux-arm64, build-linux32, build-windows32, source-distro, dynamic-distro]
1068+
needs: [build-mac-intel, build-mac-arm64, build-windows, build-linux, build-linux-arm64, build-linux-arm64-drm, build-linux32, build-windows32, source-distro, dynamic-distro]
9521069
runs-on: ubuntu-latest
9531070
steps:
9541071
- name: Merge All Artifacts

0 commit comments

Comments
 (0)