Files
donnyandClaude Fable 5.1 26f9baf9b4 core: import the rules core (ygopro-core 973672dc + fork patches)
The vendored ocgcore from the Unity repo (Tools/YGOLegacy/ocgcore at dev
HEAD). Upstream is nanahira/ygopro-core at 973672dc9ce7cb49f47173277ab1ad0e318b7593;
the seven files that differ from it carry the fork's core patches, already
applied: 0001 face-down Token setcode, 0004 effect damage step outside a
chain, 0008 Sandbox god mode, 0015 tag first seat holds the hand, 0022
attack preview, 0024 attack preview legality. Generated build/ output is
left out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:16 -07:00

270 lines
6.2 KiB
YAML

stages:
- prepare
- build
- combine
- deploy
variables:
GIT_DEPTH: "1"
.no_888:
except:
- '888'
mat_common:
stage: prepare
tags:
- linux
script:
# lua
- wget -O - https://mat-cacher.moenext.com/https://www.lua.org/ftp/lua-5.4.8.tar.gz | tar zfx -
- mv lua-5.4.8 lua
- cp premake/lua.lua lua/premake5.lua
- wget -O - https://mat-cacher.moenext.com/https://www.sqlite.org/2026/sqlite-autoconf-3510300.tar.gz | tar zfx -
- mv sqlite-autoconf-3510300 sqlite3
artifacts:
paths:
- lua
- sqlite3
mat_windows:
extends: .no_888
stage: prepare
tags:
- linux
script:
# premake5.exe
- wget https://cdn02.moecube.com:444/premake5-built/premake-5.0.0-beta8-windows.zip
- 7z x -y premake-5.0.0-beta8-windows.zip
artifacts:
paths:
- premake5.exe
mat_macos:
extends: .no_888
stage: prepare
tags:
- linux
script:
- wget -O - https://cdn02.moecube.com:444/premake5-built/premake-5.0.0-beta8-macosx.tar.gz | tar zfx -
- chmod +x premake5
artifacts:
paths:
- premake5
.build:
extends: .no_888
stage: build
dependencies:
- mat_common
artifacts:
paths:
- dist
.build_unix:
extends: .build
tags:
- noavx2
image: git-registry.moenext.com/mycard/docker-ygopro-builder:debian11
variables:
PREMAKE_OS: linux
BUILD_TYPE: x64
PREMAKE5_PATH: premake5
script:
- ln -sf premake/dll.lua .
- $PREMAKE5_PATH gmake --file=dll.lua --os=$PREMAKE_OS --sqlite3-dir=sqlite3
- cd build
- make config=release_${BUILD_TYPE} -j$(nproc)
- cd ..
- mkdir -p dist/$BUILD_TYPE
- cp build/bin/$BUILD_TYPE/Release/libocgcore.* dist/$BUILD_TYPE/
- cp build/bin/$BUILD_TYPE/Release/libsqlite3.* dist/$BUILD_TYPE/ || true
build_linux_x64:
extends: .build_unix
build_android:
extends: .build_unix
variables:
BUILD_TYPE: android_arm64
NDK_DIR: android-ndk-r23b
ANDROID_API_LEVEL: '26'
before_script:
- wget -O android-ndk-r23b-linux.zip https://mat-cacher.moenext.com/https://dl.google.com/android/repository/android-ndk-r23b-linux.zip
- 7z x -y android-ndk-r23b-linux.zip
build_linux_x64_no_longjmp:
extends: .build_unix
except: []
only:
- '888'
variables:
NO_LONGJMP: '1'
build_linux_x32:
extends: .build_unix
variables:
BUILD_TYPE: x32
before_script:
- apt update; apt -y install gcc-multilib g++-multilib
build_wasm_cjs:
extends: .build_unix
except: []
variables:
PREMAKE_OS: emscripten
BUILD_TYPE: wasm_cjs
image: git-registry.moenext.com/mycard/docker-ygopro-builder:debian12
build_wasm_esm:
extends: .build_unix
variables:
PREMAKE_OS: emscripten
BUILD_TYPE: wasm_esm
image: git-registry.moenext.com/mycard/docker-ygopro-builder:debian12
.build_windows:
extends: .build
dependencies:
- mat_common
- mat_windows
tags:
- vs
before_script:
- copy premake\dll.lua dll.lua
- '.\premake5.exe vs2026 --file=dll.lua --sqlite3-dir=sqlite3'
- mkdir dist
build_windows_x32:
extends: .build_windows
script:
- cmd /c '"C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" build\ocgcoredll.slnx /t:Build /p:Configuration=Release /p:Platform=Win32'
- mkdir dist\x32
- copy build\bin\x32\Release\ocgcore.dll dist\x32\ocgcore.dll
- copy build\bin\x32\Release\sqlite3.dll dist\x32\sqlite3.dll
build_windows_x64:
extends: .build_windows
script:
- cmd /c '"C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\msbuild.exe" build\ocgcoredll.slnx /t:Build /p:Configuration=Release /p:Platform=x64'
- mkdir dist\x64
- copy build\bin\x64\Release\ocgcore.dll dist\x64\ocgcore.dll
- copy build\bin\x64\Release\sqlite3.dll dist\x64\sqlite3.dll
.build_macos_arch:
extends: .build_unix
tags:
- macos
dependencies:
- mat_common
- mat_macos
variables:
PREMAKE_OS: macosx
PREMAKE5_PATH: ./premake5
before_script:
- rm -rf sqlite3/VERSION sqlite3/version
build_macos_x64:
extends: .build_macos_arch
variables:
BUILD_TYPE: x64
build_macos_m1:
extends: .build_macos_arch
tags:
- macos-m1
variables:
BUILD_TYPE: arm64
build_macos:
extends: .no_888
stage: combine
dependencies:
- build_macos_x64
- build_macos_m1
tags:
- macos
script:
- mkdir -p dist/macos
- lipo -create -output dist/macos/libocgcore.dylib dist/x64/libocgcore.dylib dist/arm64/libocgcore.dylib
- lipo -create -output dist/macos/libsqlite3.dylib dist/x64/libsqlite3.dylib dist/arm64/libsqlite3.dylib
- rm -rf dist/x64 dist/arm64
artifacts:
paths:
- dist
upload_to_minio:
stage: deploy
dependencies:
- build_android
- build_linux_x32
- build_linux_x64
- build_windows_x32
- build_windows_x64
- build_macos
- build_wasm_cjs
- build_wasm_esm
tags:
- linux
variables:
MINIO_DIR: 'libocgcore-koishi'
script:
- aws s3 --endpoint=https://minio.moenext.com:9000 sync --delete dist/ s3://mycard/$MINIO_DIR
only:
- master
upload_to_minio_develop:
extends: upload_to_minio
variables:
MINIO_DIR: 'libocgcore-koishi-develop'
only:
- develop
.deploy_to_server:
stage: deploy
tags:
- linux
variables:
SERVER_USER: nanahira
SERVER_HOST: koishi.momobako.com
FROM_PATH: ''
SERVER_PATH: ''
script:
- apt update && apt -y install openssh-client rsync coreutils
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SERVER_HOST >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/*
- rsync -4cavzP $FROM_PATH $SERVER_USER@$SERVER_HOST:$SERVER_PATH
deploy_888_so:
extends: .deploy_to_server
dependencies:
- build_linux_x64_no_longjmp
variables:
FROM_PATH: 'dist/x64/libocgcore.so'
SERVER_PATH: '~/ygopro-super-pre/bin/release/'
only:
- '888'
deploy_888_wasm:
extends: .deploy_to_server
dependencies:
- build_wasm_cjs
variables:
FROM_PATH: 'dist/wasm_cjs/'
SERVER_PATH: '~/srvpro2/888/wasm/'
only:
- '888'
deploy_8888_wasm:
extends: .deploy_to_server
dependencies:
- build_wasm_cjs
variables:
FROM_PATH: 'dist/wasm_cjs/'
SERVER_PATH: '~/srvpro2/8888/wasm/'
only:
- 'develop'