Skip to content

Commit 686cc6a

Browse files
committed
2 parents 8e63d31 + dcc911c commit 686cc6a

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build raylib Libraries
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-latest
12+
arch: x86_64
13+
- os: ubuntu-latest
14+
arch: arm64
15+
- os: windows-latest
16+
arch: x86_64
17+
triplet: x64-windows
18+
arch-cmake: x64
19+
- os: windows-latest
20+
arch: x86
21+
triplet: x86-windows
22+
arch-cmake: win32
23+
- os: windows-latest
24+
arch: arm64
25+
triplet: arm64-windows
26+
arch-cmake: arm64
27+
- os: macos-latest
28+
arch: x86_64
29+
- os: macos-latest
30+
arch: arm64
31+
32+
steps:
33+
- uses: actions/[email protected]
34+
with:
35+
repository: 'raysan5/raylib'
36+
path: 'raylib'
37+
ref: '5.0'
38+
submodules: true
39+
40+
- name: Install Dependencies on Ubuntu
41+
if: matrix.os == 'ubuntu-latest'
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y build-essential cmake libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev
45+
46+
- name: Install Cross-Compilation Tools for ARM64
47+
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
48+
run: |
49+
sudo dpkg --add-architecture arm64
50+
sudo apt-get update
51+
sudo apt-get install -y libasound2-dev:arm64 libx11-dev:arm64 libxrandr-dev:arm64 libxi-dev:arm64 libgl1-mesa-dev:arm64 libglu1-mesa-dev:arm64 libxcursor-dev:arm64 libxinerama-dev:arm64 libwayland-dev:arm64 libxkbcommon-dev:arm64
52+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
53+
54+
- name: Configure Raylib with CMake for ARM64 on Linux
55+
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
56+
run: |
57+
cd raylib
58+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF
59+
60+
- name: Configure Raylib with CMake on Windows
61+
if: matrix.os == 'windows-latest'
62+
run: |
63+
cd raylib
64+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.arch-cmake }} -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF
65+
66+
- name: Configure Raylib with CMake on macOS
67+
if: matrix.os == 'macos-latest'
68+
run: |
69+
cd raylib
70+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch-cmake }} -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF
71+
72+
- name: Configure Raylib with CMake on Linux (x86_64)
73+
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
74+
run: |
75+
cd raylib
76+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF
77+
78+
- name: Build raylib
79+
run: cmake --build raylib/build --config Release
80+
81+
- name: Upload Artifacts
82+
uses: actions/[email protected]
83+
with:
84+
name: ${{ matrix.os }}-${{ matrix.arch }}-artifacts
85+
path: |
86+
raylib/build/raylib/Release/*.dll
87+
raylib/build/raylib/*.so
88+
raylib/build/raylib/*.dylib
89+
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'

0 commit comments

Comments
 (0)