Skip to content

Commit 0dc89d8

Browse files
authored
Merge branch 'master' into cpp17
2 parents d2fbbc8 + 65e21a1 commit 0dc89d8

14 files changed

Lines changed: 533 additions & 354 deletions

File tree

.github/workflows/build.yml

Lines changed: 361 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,361 @@
1+
name: Automated Test Build
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build-windows:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [windows-2019, windows-2022]
15+
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- name: Checkout repository with submodules
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 1
23+
submodules: true
24+
25+
- name: Update submodules
26+
run: |
27+
cd ocgcore
28+
git checkout master
29+
git pull origin master
30+
cd ..
31+
# cd script
32+
# git checkout master
33+
# git pull origin master
34+
# cd ..
35+
36+
- name: Download premake
37+
id: premake
38+
uses: mercury233/action-cache-download-file@v1.0.0
39+
with:
40+
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta5/premake-5.0.0-beta5-windows.zip
41+
filename: premake5.zip
42+
43+
- name: Extract premake
44+
run: |
45+
7z x ${{ steps.premake.outputs.filepath }}
46+
47+
- name: Download libevent
48+
id: libevent
49+
uses: mercury233/action-cache-download-file@v1.0.0
50+
with:
51+
url: https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
52+
filename: libevent.tar.gz
53+
54+
- name: Extract libevent
55+
run: |
56+
tar xf ${{ steps.libevent.outputs.filepath }}
57+
move libevent-2.0.22-stable event
58+
xcopy /E event\WIN32-Code event\include
59+
60+
- name: Download freetype
61+
id: freetype
62+
uses: mercury233/action-cache-download-file@v1.0.0
63+
with:
64+
url: http://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
65+
66+
- name: Extract freetype
67+
run: |
68+
tar xf ${{ steps.freetype.outputs.filepath }}
69+
move freetype-2.13.3 freetype
70+
71+
- name: Download lua
72+
id: lua
73+
uses: mercury233/action-cache-download-file@v1.0.0
74+
with:
75+
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
76+
77+
- name: Extract lua
78+
run: |
79+
tar xf ${{ steps.lua.outputs.filepath }}
80+
move lua-5.4.7 lua
81+
82+
- name: Download sqlite
83+
id: sqlite
84+
uses: mercury233/action-cache-download-file@v1.0.0
85+
with:
86+
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
87+
88+
- name: Extract sqlite
89+
run: |
90+
7z x ${{ steps.sqlite.outputs.filepath }}
91+
move sqlite-amalgamation-3490100 sqlite3
92+
93+
- name: Download irrKlang
94+
id: irrKlang
95+
uses: mercury233/action-cache-download-file@v1.0.0
96+
with:
97+
url: https://www.ambiera.at/downloads/irrKlang-32bit-1.6.0.zip
98+
99+
- name: Extract irrKlang
100+
run: |
101+
7z x ${{ steps.irrKlang.outputs.filepath }}
102+
move irrKlang-1.6.0 irrKlang
103+
104+
- name: Download irrlicht
105+
run: |
106+
git clone --depth=1 https://github.com/mercury233/irrlicht
107+
108+
- name: Check DirectX SDK
109+
id: dxsdk
110+
uses: actions/cache@v4
111+
with:
112+
key: dxsdk
113+
path: DXSDK
114+
115+
- name: Download DirectX SDK
116+
if: steps.dxsdk.outputs.cache-hit != 'true'
117+
id: dxsdk-download
118+
uses: mercury233/action-cache-download-file@v1.0.0
119+
with:
120+
url: https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
121+
122+
- name: Install DirectX SDK
123+
if: steps.dxsdk.outputs.cache-hit != 'true'
124+
run: |
125+
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
126+
127+
- name: Set DirectX SDK environment variable
128+
run: |
129+
$dxsdkPath = Resolve-Path 'DXSDK'
130+
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
131+
132+
- name: Copy premake files
133+
run: |
134+
xcopy /E premake\* .
135+
136+
- name: Use premake to generate Visual Studio solution (2019)
137+
if: matrix.os == 'windows-2019'
138+
run: |
139+
.\premake5.exe vs2019 --winxp-support
140+
141+
- name: Use premake to generate Visual Studio solution (2022)
142+
if: matrix.os == 'windows-2022'
143+
run: |
144+
.\premake5.exe vs2022
145+
146+
- name: Add msbuild to PATH
147+
uses: microsoft/setup-msbuild@v2
148+
149+
- name: Build solution
150+
run: |
151+
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
152+
153+
- name: Upload build artifacts
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: YGOPro-${{ matrix.os }}
157+
path: |
158+
bin/release/YGOPro.exe
159+
160+
build-linux:
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
os:
165+
# - ubuntu-20.04
166+
- ubuntu-22.04
167+
- ubuntu-24.04
168+
include:
169+
# - os: ubuntu-20.04
170+
# premake_version: 5.0.0-beta2
171+
- os: ubuntu-22.04
172+
premake_version: 5.0.0-beta4
173+
- os: ubuntu-24.04
174+
premake_version: 5.0.0-beta5
175+
176+
runs-on: ${{ matrix.os }}
177+
178+
steps:
179+
- name: Checkout repository with submodules
180+
uses: actions/checkout@v4
181+
with:
182+
fetch-depth: 1
183+
submodules: true
184+
185+
- name: Update submodules
186+
run: |
187+
cd ocgcore
188+
git checkout master
189+
git pull origin master
190+
cd ..
191+
# cd script
192+
# git checkout master
193+
# git pull origin master
194+
# cd ..
195+
196+
- name: Install dependencies
197+
run: |
198+
sudo apt-get update
199+
sudo apt-get install -y libevent-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libsqlite3-dev libxxf86vm-dev
200+
201+
- name: Download premake
202+
id: premake
203+
uses: mercury233/action-cache-download-file@v1.0.0
204+
with:
205+
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-linux.tar.gz
206+
filename: premake5.tar.gz
207+
208+
- name: Extract premake
209+
run: |
210+
tar xf ${{ steps.premake.outputs.filepath }}
211+
chmod +x ./premake5
212+
213+
- name: Download lua
214+
id: lua
215+
uses: mercury233/action-cache-download-file@v1.0.0
216+
with:
217+
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
218+
219+
- name: Extract lua
220+
run: |
221+
tar xf ${{ steps.lua.outputs.filepath }}
222+
mv lua-5.4.7 lua
223+
224+
- name: Download irrlicht
225+
run: |
226+
git clone --depth=1 https://github.com/mercury233/irrlicht
227+
228+
- name: Copy premake files
229+
run: |
230+
cp -r premake/* .
231+
232+
- name: Use premake to generate make files
233+
run: |
234+
./premake5 gmake \
235+
--no-use-irrklang \
236+
--freetype-include-dir="/usr/include/freetype2"
237+
238+
- name: Make
239+
run: |
240+
cd build
241+
make -j 4 config=release
242+
cd ..
243+
244+
- name: Upload build artifacts
245+
uses: actions/upload-artifact@v4
246+
with:
247+
name: YGOPro-${{ matrix.os }}
248+
path: |
249+
bin/release/YGOPro
250+
251+
build-macos:
252+
strategy:
253+
fail-fast: false
254+
matrix:
255+
os:
256+
- macos-13
257+
- macos-15
258+
include:
259+
- os: macos-13
260+
premake_version: 5.0.0-beta5
261+
- os: macos-15
262+
premake_version: 5.0.0-beta5
263+
264+
runs-on: ${{ matrix.os }}
265+
266+
steps:
267+
- name: Checkout repository with submodules
268+
uses: actions/checkout@v4
269+
with:
270+
fetch-depth: 1
271+
submodules: true
272+
273+
- name: Update submodules
274+
run: |
275+
cd ocgcore
276+
git checkout master
277+
git pull origin master
278+
cd ..
279+
# cd script
280+
# git checkout master
281+
# git pull origin master
282+
# cd ..
283+
284+
# - name: Install dependencies
285+
# run: |
286+
# brew install freetype libevent libx11 sqlite zlib
287+
288+
- name: Download premake
289+
id: premake
290+
uses: mercury233/action-cache-download-file@v1.0.0
291+
with:
292+
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-macosx.tar.gz
293+
filename: premake5.tar.gz
294+
295+
- name: Extract premake
296+
run: |
297+
tar xf ${{ steps.premake.outputs.filepath }}
298+
chmod +x ./premake5
299+
300+
- name: Download lua
301+
id: lua
302+
uses: mercury233/action-cache-download-file@v1.0.0
303+
with:
304+
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
305+
306+
- name: Extract lua
307+
run: |
308+
tar xf ${{ steps.lua.outputs.filepath }}
309+
mv lua-5.4.7 lua
310+
311+
- name: Download irrlicht
312+
run: |
313+
git clone --depth=1 https://github.com/mercury233/irrlicht
314+
315+
- name: Build irrlicht
316+
run: |
317+
cd irrlicht/source/Irrlicht/MacOSX
318+
xcodebuild -project MacOSX.xcodeproj
319+
cd ../../../..
320+
321+
- name: Copy premake files
322+
run: |
323+
cp -r premake/* .
324+
325+
- name: Use premake to generate make files (Intel)
326+
if: runner.arch == 'X64'
327+
run: |
328+
./premake5 gmake \
329+
--cc=clang \
330+
--no-use-irrklang \
331+
--freetype-include-dir="/usr/local/include/freetype2" \
332+
--irrlicht-include-dir="../irrlicht/include" \
333+
--irrlicht-lib-dir="../irrlicht/source/Irrlicht/MacOSX/build/Release"
334+
335+
- name: Use premake to generate make files (ARM64)
336+
if: runner.arch == 'ARM64'
337+
run: |
338+
./premake5 gmake \
339+
--cc=clang \
340+
--no-use-irrklang \
341+
--event-include-dir="/opt/homebrew/include" \
342+
--event-lib-dir="/opt/homebrew/lib" \
343+
--freetype-include-dir="/opt/homebrew/include/freetype2" \
344+
--freetype-lib-dir="/opt/homebrew/lib" \
345+
--sqlite-include-dir="/opt/homebrew/opt/sqlite/include" \
346+
--sqlite-lib-dir="/opt/homebrew/opt/sqlite/lib" \
347+
--irrlicht-include-dir="../irrlicht/include" \
348+
--irrlicht-lib-dir="../irrlicht/source/Irrlicht/MacOSX/build/Release"
349+
350+
- name: Make
351+
run: |
352+
cd build
353+
make -j 3 config=release
354+
cd ..
355+
356+
- name: Upload build artifacts
357+
uses: actions/upload-artifact@v4
358+
with:
359+
name: YGOPro-${{ matrix.os }}
360+
path: |
361+
bin/*

0 commit comments

Comments
 (0)