-
-
Notifications
You must be signed in to change notification settings - Fork 5
218 lines (188 loc) · 5.8 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Build Raylib-CSharp
on:
release:
types: [ "published" ]
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
raylib_version: '5.0'
jobs:
# Build for Win
build-win:
runs-on: windows-latest
strategy:
matrix:
name: [win32, x64]
# Run
steps:
- uses: actions/checkout@v4
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Build Raylib
- name: Build Raylib
shell: bash
run: |
curl -Lso raylib.zip https://github.com/raysan5/raylib/archive/refs/tags/${{ env.raylib_version }}.zip
unzip -qq raylib.zip
cmake -S raylib-${{ env.raylib_version }} \
-A ${{ matrix.name }} \
-B native \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_EXAMPLES=OFF \
-D CUSTOMIZE_BUILD=ON \
-D SUPPORT_GIF_RECORDING=OFF \
-D SUPPORT_SCREEN_CAPTURE=OFF
cmake --build native --config Release
# Upload Raylib
- name: Upload Raylib
uses: actions/upload-artifact@v4
with:
name: win-${{ matrix.name }}
path: native/raylib/Release/raylib.dll
if-no-files-found: error
# Build for Linux
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
name: [x64]
# Run
steps:
- uses: actions/checkout@v4
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Setup dependencies
- name: Setup dependencies
run: |
sudo apt-get install -y \
libasound2-dev \
libxrandr-dev \
libx11-dev \
libxi-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libxcursor-dev \
libxinerama-dev
# Build Raylib
- name: Build Raylib
run: |
curl -Lso raylib.zip https://github.com/raysan5/raylib/archive/refs/tags/${{ env.raylib_version }}.zip
unzip -qq raylib.zip
cmake -S raylib-${{ env.raylib_version }} \
-B native \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_EXAMPLES=OFF \
-D CUSTOMIZE_BUILD=ON \
-D SUPPORT_GIF_RECORDING=OFF \
-D SUPPORT_SCREEN_CAPTURE=OFF
cmake --build native --config Release
# Upload Raylib
- name: Upload Raylib
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.name }}
path: native/raylib/libraylib.so
if-no-files-found: error
# Build for OSX
build-osx:
runs-on: macos-latest
strategy:
matrix:
name: [arm64, x86_64]
# Run
steps:
- uses: actions/checkout@v4
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Build Raylib
- name: Build Raylib
run: |
curl -Lso raylib.zip https://github.com/raysan5/raylib/archive/refs/tags/${{ env.raylib_version }}.zip
unzip -qq raylib.zip
cmake -S raylib-${{ env.raylib_version }} \
-B native \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_ARCHITECTURES=${{ matrix.name }} \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_EXAMPLES=OFF \
-D CUSTOMIZE_BUILD=ON \
-D SUPPORT_GIF_RECORDING=OFF \
-D SUPPORT_SCREEN_CAPTURE=OFF
cmake --build native --config Release
# Upload Raylib
- name: Upload Raylib
uses: actions/upload-artifact@v4
with:
name: osx-${{ matrix.name }}
path: native/raylib/libraylib.dylib
if-no-files-found: error
# Publish to NuGet
publish-nuget:
runs-on: ubuntu-latest
needs: [build-win, build-linux, build-osx]
# Run
steps:
- uses: actions/checkout@v4
# Setup .NET
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Setup dependencies
- name: Setup dependencies
run: |
sudo apt-get install -y \
libasound2-dev \
libxrandr-dev \
libx11-dev \
libxi-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libxcursor-dev \
libxinerama-dev
# Windows x86
- uses: actions/download-artifact@v4
with:
name: win-win32
path: src/Raylib-CSharp/runtimes/win-x86/native
# Windows x64
- uses: actions/download-artifact@v4
with:
name: win-x64
path: src/Raylib-CSharp/runtimes/win-x64/native
# Linux x64
- uses: actions/download-artifact@v4
with:
name: linux-x64
path: src/Raylib-CSharp/runtimes/linux-x64/native
# OSX arm64
- uses: actions/download-artifact@v4
with:
name: osx-arm64
path: src/Raylib-CSharp/runtimes/osx-arm64/native
# OSX x64
- uses: actions/download-artifact@v4
with:
name: osx-x86_64
path: src/Raylib-CSharp/runtimes/osx-x64/native
# Build and pack NuGet package
- name: Build and pack NuGet package
if: github.event_name == 'release'
run: dotnet pack src/Raylib-CSharp -p:PackageVersion=${{ github.event.release.tag_name }} --configuration Release --output nuget
# Publish NuGet package
- name: Publish NuGet package
if: github.event_name == 'release'
run: dotnet nuget push nuget/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json