Commit 4846a527 authored by nanahira's avatar nanahira

update ci

parent 76db1bbd
Pipeline #34329 failed with stages
in 3 minutes and 46 seconds
#!/bin/sh
set -x
set -o errexit
cd miniaudio
external_built_dir="$PWD/external-built"
is_macos=false
if [ "$(uname)" = "Darwin" ]; then
is_macos=true
fi
maybe_patch_configure() {
if $is_macos; then
sed -i.bak 's/-force_cpusubtype_ALL//g' configure*
fi
}
build_single_thing() {
lib_name="$1"
cd "external/$lib_name"
shift
maybe_patch_configure
PKG_CONFIG_PATH="$external_built_dir/lib/pkgconfig" ./configure --prefix="$external_built_dir" --enable-static=yes --enable-shared=no "$@"
make -j$(nproc)
make install
cd ../..
}
build_single_thing ogg
build_single_thing opus
build_single_thing opusfile --disable-examples --disable-http
build_single_thing vorbis --with-ogg="$external_built_dir"
cd ..
...@@ -8,14 +8,20 @@ export EVENT_INCLUDE_DIR=$PWD/libevent-stable/include ...@@ -8,14 +8,20 @@ export EVENT_INCLUDE_DIR=$PWD/libevent-stable/include
export EVENT_LIB_DIR=$PWD/libevent-stable/lib export EVENT_LIB_DIR=$PWD/libevent-stable/lib
export IRRLICHT_INCLUDE_DIR=$PWD/irrlicht/include export IRRLICHT_INCLUDE_DIR=$PWD/irrlicht/include
export IRRLICHT_LIB_DIR=$PWD/irrlicht/lib/$(arch) export IRRLICHT_LIB_DIR=$PWD/irrlicht/lib/$(arch)
export OPUS_INCLUDE_DIR=$PWD/miniaudio/external-built/include/opus
export OPUS_LIB_DIR=$PWD/miniaudio/external-built/lib
export VORBIS_INCLUDE_DIR=$PWD/miniaudio/external-built/include
export VORBIS_LIB_DIR=$PWD/miniaudio/external-built/lib
export OGG_INCLUDE_DIR=$PWD/miniaudio/external-built/include
export OGG_LIB_DIR=$PWD/miniaudio/external-built/lib
./.ci/libevent-prebuild.sh ./.ci/libevent-prebuild.sh
./.ci/build-opus.sh
chmod +x ./premake5 ./premake5 gmake --cc=clang --build-freetype --build-sqlite
./premake5 gmake --cc=clang --build-freetype --build-sqlite --no-use-irrklang
cd build cd build
make config=release -j4 make config=release -j$(nproc)
cd .. cd ..
mkdir ygopro-platforms mkdir ygopro-platforms
......
...@@ -5,4 +5,4 @@ set -o errexit ...@@ -5,4 +5,4 @@ set -o errexit
apt update && apt -y install tar git zstd apt update && apt -y install tar git zstd
mkdir dist replay mkdir dist replay
tar --zstd -cf dist/ygopro-$CI_COMMIT_REF_NAME-darwin-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay windbot bot bot.conf pack tar --zstd -cf dist/ygopro-$CI_COMMIT_REF_NAME-darwin-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf pack
#!/bin/sh
set -x
set -o errexit
if [ ! -d "miniaudio" ]; then
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
fi
mkdir -p miniaudio/external
install_external() {
dir="$1"
url="$2"
if [ ! -d "miniaudio/external/$dir" ]; then
mkdir -p "miniaudio/external/$dir"
# Download the external library and strip one level of directories from the archive
wget -O - "$url" | tar --strip-components=1 -C "miniaudio/external/$dir" -zxf -
fi
}
install_external "ogg" "https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz"
install_external "opus" "https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz"
install_external "opusfile" "https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz"
install_external "vorbis" "https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz"
...@@ -23,6 +23,8 @@ mat_common: ...@@ -23,6 +23,8 @@ mat_common:
# freetype # freetype
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx -
- mv freetype-2.11.1 freetype - mv freetype-2.11.1 freetype
# miniaudio
- ./.ci/prepare-miniaudio.sh
# premake # premake
- cp -rf premake/* .; - cp -rf premake/* .;
artifacts: artifacts:
...@@ -45,21 +47,6 @@ mat_submodules: ...@@ -45,21 +47,6 @@ mat_submodules:
- ocgcore - ocgcore
- script - script
mat_irrklang:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install git
- mkdir -p ~/.ssh; chmod 700 ~/.ssh; echo "$NANAHIRA_SSH_KEY" | base64 --decode > ~/.ssh/id_rsa; chmod 600 ~/.ssh/id_rsa
- ssh-keyscan git.mycard.moe >> ~/.ssh/known_hosts
- git clone --depth=1 git@git.mycard.moe:nanahira/irrklang
- mv -f irrklang/plugins/ikpmp3 .
artifacts:
paths:
- irrklang
- ikpmp3
mat_linux: mat_linux:
stage: prepare stage: prepare
tags: tags:
...@@ -76,17 +63,6 @@ mat_linux: ...@@ -76,17 +63,6 @@ mat_linux:
# - libevent-stable # - libevent-stable
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11 image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
#mat_macos_irrklang_patched:
# stage: build
# tags:
# - linux
# dependencies: []
# script:
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libirrklang-patched-dylib.tar.gz | tar zfx -
# artifacts:
# paths:
# - libirrklang-patched.dylib
mat_macos: mat_macos:
stage: prepare stage: prepare
tags: tags:
...@@ -94,7 +70,6 @@ mat_macos: ...@@ -94,7 +70,6 @@ mat_macos:
script: script:
- apt update; apt -y install wget tar - apt update; apt -y install wget tar
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-macosx.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-macosx.tar.gz | tar zfx -
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libirrklang-patched-dylib.tar.gz | tar zfx -
- mkdir irrlicht - mkdir irrlicht
- cd irrlicht - cd irrlicht
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/irrlicht-mycard-mac.tar.gz | tar zfx - - wget -O - https://cdn01.moecube.com/ygopro-build-materials/irrlicht-mycard-mac.tar.gz | tar zfx -
...@@ -130,7 +105,6 @@ exec_windows: ...@@ -130,7 +105,6 @@ exec_windows:
- vs - vs
dependencies: dependencies:
- mat_common - mat_common
- mat_irrklang
- mat_windows - mat_windows
- mat_submodules - mat_submodules
cache: cache:
...@@ -140,7 +114,7 @@ exec_windows: ...@@ -140,7 +114,7 @@ exec_windows:
- obj/ - obj/
script: script:
- bash -c 'cp -rf premake/* .' - bash -c 'cp -rf premake/* .'
- '.\premake5.exe vs2019 --irrklang-pro' - '.\premake5.exe vs2019'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release' - cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
- copy bin\release\ygopro.exe . - copy bin\release\ygopro.exe .
artifacts: artifacts:
...@@ -151,24 +125,28 @@ exec_linux: ...@@ -151,24 +125,28 @@ exec_linux:
stage: build stage: build
tags: tags:
- linux - linux
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
dependencies: dependencies:
- mat_common - mat_common
- mat_irrklang
- mat_linux - mat_linux
- mat_submodules - mat_submodules
variables:
EVENT_INCLUDE_DIR: /usr/share/libevent-stable/include
EVENT_LIB_DIR: /usr/share/libevent-stable/lib
OPUS_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include/opus
OPUS_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
VORBIS_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include
VORBIS_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
OGG_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include
OGG_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
cache: cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths: paths:
- bin/ - bin/
- obj/ - obj/
script: script:
- apt update; apt -y install git build-essential libgl1-mesa-dev libglu-dev libxxf86vm-dev - ./.ci/build-opus.sh
- mkdir lib - premake5 gmake --build-freetype --build-sqlite --build-irrlicht
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so ./lib/
# - cp -rf irrklang/bin/linux-gcc-64/ikpMP3.so ./lib/
- export EVENT_INCLUDE_DIR=/usr/share/libevent-stable/include
- export EVENT_LIB_DIR=/usr/share/libevent-stable/lib
- premake5 gmake --build-freetype --build-sqlite --build-irrlicht --build-ikpmp3 --irrklang-pro
- cd build - cd build
- make config=release -j$(nproc) - make config=release -j$(nproc)
- cd .. - cd ..
...@@ -177,8 +155,6 @@ exec_linux: ...@@ -177,8 +155,6 @@ exec_linux:
artifacts: artifacts:
paths: paths:
- ygopro - ygopro
- lib
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
.exec_macos_platform: .exec_macos_platform:
stage: build stage: build
...@@ -215,17 +191,11 @@ exec_macos: ...@@ -215,17 +191,11 @@ exec_macos:
dependencies: dependencies:
- exec_macos_platform_x86 - exec_macos_platform_x86
- exec_macos_platform_m1 - exec_macos_platform_m1
#- mat_macos_irrklang_patched
script: script:
- mkdir -p ygopro.app/Contents/MacOS ygopro.app/Contents/Frameworks; - mkdir -p ygopro.app/Contents/MacOS ygopro.app/Contents/Frameworks;
- lipo -create -output ygopro.app/Contents/MacOS/ygopro $(ls -1 ygopro-platforms/ygopro-platform-*); - lipo -create -output ygopro.app/Contents/MacOS/ygopro $(ls -1 ygopro-platforms/ygopro-platform-*);
# do some special things for irrklang
# - mv ./libirrklang-patched.dylib ygopro.app/Contents/Frameworks/libirrklang.dylib
#- install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/../Frameworks/libirrklang.dylib ygopro.app/Contents/MacOS/ygopro
#- dylibbundler -x ygopro.app/Contents/MacOS/ygopro -b -d ygopro.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ -cd -i @executable_path/../Frameworks;
#- strip ygopro.app/Contents/MacOS/ygopro;
- mkdir ygopro.app/Contents/Resources; - mkdir ygopro.app/Contents/Resources;
- mv premake/gframe/ygopro.icns ygopro.app/Contents/Resources/Icon.icns; - mv resource/gframe/ygopro.icns ygopro.app/Contents/Resources/Icon.icns;
- defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIconFile" "Icon.icns"; - defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIconFile" "Icon.icns";
- defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIdentifier" "moe.mycard.ygopro"; - defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIdentifier" "moe.mycard.ygopro";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment