Skip to content

Remove CTOS_DeckData and use uint32_t array in deck loading functions #967

Remove CTOS_DeckData and use uint32_t array in deck loading functions

Remove CTOS_DeckData and use uint32_t array in deck loading functions #967

Workflow file for this run

name: Automated Test Build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Parse pull request description for dependency overrides
id: parse-pr-override
env:
PR_BODY: ${{ github.event.pull_request.body }}
shell: python
run: |
# You can override dependencies by specifying a pull request number in the pull request description.
# This is useful when you want to test changes which require modifications in the submodules or dependencies.
# Expected description format:
# > name: NNN
# (leading >, dependency name, followed by a PR number)
# Example:
# > ocgcore: 123
# Supported dependencies:
# ocgcore, irrlicht
import re, os
body = os.environ.get('PR_BODY', '')
# Default: empty means no override
ocgcore_ref = ''
irrlicht_ref = ''
m = re.search(r'(?m)^\s*>\s*ocgcore\s*:\s*(\d+)\s*$', body)
if m:
ocgcore_ref = f'refs/pull/{m.group(1)}/head'
m = re.search(r'(?m)^\s*>\s*irrlicht\s*:\s*(\d+)\s*$', body)
if m:
irrlicht_ref = f'refs/pull/{m.group(1)}/head'
# Output the parsed refs for downstream jobs
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write(f'ocgcore-ref={ocgcore_ref}\n')
f.write(f'irrlicht-ref={irrlicht_ref}\n')
- name: Fetch ocgcore
uses: actions/checkout@v6
with:
repository: Fluorohydride/ygopro-core
path: ocgcore
ref: ${{ steps.parse-pr-override.outputs.ocgcore-ref }}
- name: Fetch Irrlicht
uses: actions/checkout@v6
with:
repository: mercury233/irrlicht
path: irrlicht
ref: ${{ steps.parse-pr-override.outputs.irrlicht-ref }}
- name: Download lua
id: lua
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://www.lua.org/ftp/lua-5.4.8.tar.gz
sha256: 4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae
- name: Extract lua
run: |
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.8 lua
- name: Download miniaudio
run: |
git clone --depth=1 -b 0.11.25 https://github.com/mackron/miniaudio
cd miniaudio
cp extras/miniaudio_split/miniaudio.* .
cd ..
- name: Upload sources
uses: actions/upload-artifact@v6
with:
name: dependencies-sources
path: |
lua/
miniaudio/
irrlicht/
ocgcore/
prepare-static-dependencies:
runs-on: ubuntu-latest
steps:
- name: Download libevent
id: libevent
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
filename: libevent.tar.gz
sha256: 92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
- name: Extract libevent
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
- name: Download freetype
id: freetype
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://downloads.sourceforge.net/freetype/freetype-2.14.2.tar.gz
sha256: 752c2671f85c54a84b7f0dd2b5cd26b6b741117033886ffbc5ac89a68464b848
- name: Extract freetype
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.14.2 freetype
- name: Download libjpeg-turbo
id: libjpeg-turbo
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.1.4.1/libjpeg-turbo-3.1.4.1.tar.gz
sha256: ecae8008e2cc9ade2f2c1bb9d5e6d4fb73e7c433866a056bd82980741571a022
- name: Extract libjpeg-turbo
run: |
tar xf ${{ steps.libjpeg-turbo.outputs.filepath }}
mv libjpeg-turbo-3.1.4.1 jpeg
cp jpeg/src/jversion.h.in jpeg/src/jversion.h
- name: Download sqlite
id: sqlite
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://www.sqlite.org/2026/sqlite-amalgamation-3510300.zip
sha256: acb1e6f5d832484bf6d32b681e858c38add8b2acdfd42ac5df24b8afb46552b4
- name: Extract sqlite
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3510300 sqlite3
- name: Create miniaudio external directory
run: |
mkdir -p miniaudio/external
- name: Download ogg
id: ogg
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/xiph/ogg/releases/download/v1.3.6/libogg-1.3.6.tar.gz
sha256: 83e6704730683d004d20e21b8f7f55dcb3383cdf84c0daedf30bde175f774638
- name: Extract ogg
run: |
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.6 miniaudio/external/ogg
- name: Download opus
id: opus
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
sha256: 65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1
- name: Extract opus
run: |
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile
id: opusfile
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
sha256: 118d8601c12dd6a44f52423e68ca9083cc9f2bfe72da7a8c1acb22a80ae3550b
- name: Extract opusfile
run: |
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis
id: vorbis
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
sha256: 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab
- name: Extract vorbis
run: |
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
- name: Upload static dependencies
uses: actions/upload-artifact@v6
with:
name: dependencies-sources-static-link
path: |
event/
freetype/
jpeg/
!jpeg/java/
!jpeg/testimgs/
sqlite3/
miniaudio/
!miniaudio/external/opus/dnn/
build-windows:
needs: [prepare, prepare-static-dependencies]
strategy:
fail-fast: false
matrix:
name:
- windows
# - windows-no-dxsdk
- windows-x64
# - windows-2025
include:
- name: windows
os: windows-2022
vs: vs2022
# - name: windows-no-dxsdk
# os: windows-2022
# vs: vs2022
# nodxsdk: true
- name: windows-x64
os: windows-2022
vs: vs2022
x64: true
# - name: windows-2025
# os: windows-2025
# vs: vs2025 # to be enabled after the release of Visual Studio 2025
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
# Git submodules are ignored in this CI script. The `prepare` job downloads them.
# For local development, use `git clone --recursive` when cloning the repository,
# and then check out the submodules to the `master` branch.
# (The submodule references recorded in this repository may be outdated).
- name: Download prepare sources
uses: actions/download-artifact@v7
with:
name: dependencies-sources
path: .
- name: Download static dependencies sources
uses: actions/download-artifact@v7
with:
name: dependencies-sources-static-link
path: .
- name: Download NASM
id: nasm
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://www.nasm.us/pub/nasm/releasebuilds/3.01/win64/nasm-3.01-win64.zip
filename: nasm.zip
sha256: e0ba5157007abc7b1a65118a96657a961ddf55f7e3f632ee035366dfce039ca4
- name: Install NASM
shell: pwsh
run: |
New-Item -ItemType Directory -Path nasm | Out-Null
Expand-Archive -Path ${{ steps.nasm.outputs.filepath }} -DestinationPath nasm
Move-Item .\nasm\nasm-3.01\nasm.exe .\nasm
$nasmPath = (Resolve-Path .\nasm).Path
$nasmPath | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta7/premake-5.0.0-beta7-windows.zip
filename: premake5.zip
sha256: 8baec7b265fd43050f006ef47000457fa93b6fafbb1ead7e333e862a467c2e95
- name: Extract premake
shell: bash
run: |
7z x ${{ steps.premake.outputs.filepath }}
- name: Check DirectX SDK
if: matrix.nodxsdk != true
id: dxsdk
uses: actions/cache@v5
with:
key: dxsdk
path: DXSDK
- name: Download DirectX SDK
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
id: dxsdk-download
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
sha256: 705271dc83bfee54d9b94e028426e288d5f070784b7446d164f48ecfbb2a02cb
- name: Install DirectX SDK
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
shell: bash
run: |
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
- name: Set DirectX SDK environment variable
if: matrix.nodxsdk != true
shell: pwsh
run: |
$dxsdkPath = Resolve-Path 'DXSDK'
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Configure libevent
shell: bash
run: |
cp premake/event/msvc-event-config.h event/include/event2/event-config.h
cp event/WIN32-Code/nmake/evconfig-private.h event/include/evconfig-private.h
- name: Copy premake files
shell: bash
run: |
cp -pr premake/* .
cp -pr resource/* .
- name: Use premake to generate Visual Studio solution
shell: pwsh
run: |
.\premake5.exe ${{ matrix.vs }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v3
- name: Build solution
shell: pwsh
run: |
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release /p:Platform=${{ matrix.x64 && 'x64' || 'Win32' }}
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: YGOPro-${{ matrix.name }}
path: |
bin/release/x86/YGOPro.exe
bin/release/x64/YGOPro.exe
build-linux:
needs: [prepare, prepare-static-dependencies]
strategy:
fail-fast: false
matrix:
name:
- ubuntu-22
- ubuntu-24
- ubuntu-static-link
include:
- name: ubuntu-22
os: ubuntu-22.04
premake-version: 5.0.0-beta4
- name: ubuntu-24
os: ubuntu-24.04
premake-version: 5.0.0-beta7
- name: ubuntu-static-link
os: ubuntu-22.04
premake-version: 5.0.0-beta4
static-link: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Download prepare sources
uses: actions/download-artifact@v7
with:
name: dependencies-sources
path: .
- name: Download static dependencies sources
if: matrix.static-link == true
uses: actions/download-artifact@v7
with:
name: dependencies-sources-static-link
path: .
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev
- name: Install dependencies (dynamic link)
if: matrix.static-link != true
run: |
sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev libjpeg-dev libpng-dev
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake-version }}/premake-${{ matrix.premake-version }}-linux.tar.gz
filename: premake5.tar.gz
- name: Extract premake
run: |
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
- name: Configure libevent
if: matrix.static-link == true
run: |
cd event
chmod +x configure build-aux/*
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
- name: Configure ogg
if: matrix.static-link == true
run: |
cd miniaudio/external/ogg
chmod +x configure
./configure
cd ../../..
- name: Copy premake files
run: |
cp -pr premake/* .
cp -pr resource/* .
- name: Use premake to generate make files (apt packages)
if: matrix.static-link != true
run: |
./premake5 gmake
- name: Use premake to generate make files (static link)
if: matrix.static-link == true
run: |
./premake5 gmake \
--build-event \
--build-jpeg \
--build-png-irrlicht \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
- name: Make
run: |
cd build
make -j 4 config=release
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: YGOPro-${{ matrix.name }}
path: |
bin/release/YGOPro
build-macos:
needs: [prepare, prepare-static-dependencies]
strategy:
fail-fast: false
matrix:
name:
- macos-15-intel
- macos-15-universal-static-link
- macos-15-arm
# - macos-15-intel-cross-compile-static-link
include:
- name: macos-15-intel
os: macos-15-intel
- name: macos-15-universal-static-link
os: macos-15
cross-build-intel: true
cross-build-arm: true
static-link: true
- name: macos-15-arm
os: macos-15
# - name: macos-15-intel-cross-compile-static-link
# os: macos-15
# cross-build-intel: true
# static-link: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Download prepare sources
uses: actions/download-artifact@v7
with:
name: dependencies-sources
path: .
- name: Download static dependencies sources
if: matrix.static-link == true
uses: actions/download-artifact@v7
with:
name: dependencies-sources-static-link
path: .
- name: Install dependencies
if: matrix.static-link != true
run: |
brew install opus opusfile libvorbis
# brew install sqlite libx11 freetype libevent libjpeg-turbo libpng
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.2.0
with:
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta7/premake-5.0.0-beta7-macosx.tar.gz
filename: premake5.tar.gz
sha256: f7a6d4978960aefbc0b2c522f211eedf014e6a2783b04a096c3716213c1bff67
- name: Extract premake
run: |
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
- name: Configure libevent
if: matrix.static-link == true
run: |
cd event
chmod +x configure build-aux/*
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
- name: Copy premake files
run: |
cp -pr premake/* .
cp -pr resource/* .
- name: Use premake to generate make files (Homebrew packages)
if: matrix.static-link != true
run: |
DYLD_LIBRARY_PATH=$(brew --prefix)/lib ./premake5 gmake
- name: Use premake to generate make files (static link)
if: matrix.static-link == true
run: |
./premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} \
--build-event \
--build-jpeg \
--build-png-irrlicht \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
- name: Make
run: |
cd build
make -j 3 config=release
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: YGOPro-${{ matrix.name }}
path: |
bin/release/YGOPro