Commit d4af3219 authored by nanahira's avatar nanahira

use develop ci

parent cc97b157
export ASSET_BRANCH_NAME="master"
# if $CI_COMMIT_REF_NAME includes develop or pre, then we use the develop branch
if [[ "$CI_COMMIT_REF_NAME" == *"develop"* || "$CI_COMMIT_REF_NAME" == *".pre"* ]]; then
export ASSET_BRANCH_NAME="develop"
fi
#!/bin/bash #!/bin/bash
set -x set -x
set -o errexit set -o errexit
source .ci/asset-branch
# ygopro-database # ygopro-database
apt update && apt -y install wget git libarchive-tools apt update && apt -y install wget git libarchive-tools sqlite3
git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database git clone --depth=1 -b "$ASSET_BRANCH_NAME" https://code.moenext.com/mycard/ygopro-database
cp -rf ./ygopro-database/locales/$TARGET_LOCALE/* . cp -rf ./ygopro-database/locales/$TARGET_LOCALE/strings.conf .
rm -f cards.cdb
sqlite3 ./ygopro-database/locales/$TARGET_LOCALE/cards.cdb .dump | sqlite3 cards.cdb
# ygopro-images # ygopro-images
mkdir pics mkdir pics
wget -O - https://cdn01.moecube.com/images/ygopro-images-${TARGET_LOCALE}.zip | bsdtar -C pics -xf - if [[ "$ASSET_BRANCH_NAME" == "develop" ]]; then
echo "This is a pre-release, skipping download."
else
wget -O - https://cdn02.moecube.com:444/images/ygopro-images-${TARGET_LOCALE}.zip | bsdtar -C pics -xf -
fi
#!/bin/bash
libs_to_configure=(
"ogg"
# "opus"
)
cd miniaudio/external
for lib in "${libs_to_configure[@]}"; do
cd $lib
./configure
cd ..
done
#!/bin/sh
set -x
set -o errexit
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
...@@ -4,18 +4,15 @@ set -o errexit ...@@ -4,18 +4,15 @@ set -o errexit
TARGET_PLATFORM=$(arch) TARGET_PLATFORM=$(arch)
TARGET_YGOPRO_BINARY_PATH=./ygopro-platforms/ygopro-platform-$TARGET_PLATFORM TARGET_YGOPRO_BINARY_PATH=./ygopro-platforms/ygopro-platform-$TARGET_PLATFORM
export EVENT_INCLUDE_DIR=$PWD/libevent-stable/include
export EVENT_LIB_DIR=$PWD/libevent-stable/lib
export IRRLICHT_INCLUDE_DIR=$PWD/irrlicht/include
export IRRLICHT_LIB_DIR=$PWD/irrlicht
./.ci/libevent-prebuild.sh ./.ci/configure-audio.sh
chmod +x ./premake5 rm -rf sqlite3/VERSION sqlite3/version
./premake5 gmake --cc=clang --build-freetype --build-sqlite --no-use-irrklang
./premake5 gmake --cc=clang
cd build cd build
make config=release -j4 make config=release -j$(sysctl -n hw.ncpu)
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-linux-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro LICENSE README.md lib lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf pack tar --zstd -cf dist/ygopro-$CI_COMMIT_REF_NAME-linux-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf pack fonts
...@@ -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 fonts
...@@ -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-win32-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound bot.conf Bot.exe WindBot pack tar --zstd -cf dist/ygopro-$CI_COMMIT_REF_NAME-win32-$TARGET_LOCALE.tar.zst --exclude='.git*' ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound bot.conf Bot.exe WindBot pack fonts
#!/bin/bash
set -x
set -o errexit
source .ci/asset-branch
IRRLICHT_REPO_URL="https://code.moenext.com/mycard/irrlicht-new.git"
IRRLICHT_BRANCH_NAME="$ASSET_BRANCH_NAME"
if [ ! -d "irrlicht" ]; then
git clone --depth=1 --branch "$IRRLICHT_BRANCH_NAME" "$IRRLICHT_REPO_URL" irrlicht
else
cd irrlicht
git fetch origin "$IRRLICHT_BRANCH_NAME"
git checkout "$IRRLICHT_BRANCH_NAME"
git reset --hard origin/"$IRRLICHT_BRANCH_NAME"
cd ..
fi
#!/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
cp -rf miniaudio/extras/miniaudio_split/miniaudio.* miniaudio/
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"
...@@ -33,9 +33,15 @@ runForDepot() { ...@@ -33,9 +33,15 @@ runForDepot() {
echo "$result" | jq . echo "$result" | jq .
} }
runForDepot win32 zh-CN source .ci/asset-branch
runForDepot linux zh-CN
runForDepot darwin zh-CN if [[ "$ASSET_BRANCH_NAME" == "develop" ]]; then
runForDepot win32 en-US echo "This is a pre-release, skipping upload."
runForDepot linux en-US else
runForDepot darwin en-US runForDepot win32 zh-CN
runForDepot linux zh-CN
runForDepot darwin zh-CN
runForDepot win32 en-US
runForDepot linux en-US
runForDepot darwin en-US
fi
...@@ -14,14 +14,21 @@ mat_common: ...@@ -14,14 +14,21 @@ mat_common:
- linux - linux
script: script:
# lua # lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.4.4.tar.gz | tar zfx - - wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.4.7.tar.gz | tar zfx -
- mv lua-5.4.4 lua - mv lua-5.4.7 lua
# sqlite3 # sqlite3
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3390300.tar.gz | tar zfx - - wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/sqlite-autoconf-3490100.tar.gz | tar zfx -
- mv sqlite-autoconf-3390300 sqlite3 - mv sqlite-autoconf-3490100 sqlite3
# freetype # freetype
#- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx - #- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/freetype-2.13.3.tar.gz | tar zfx -
#- mv freetype-2.11.1 freetype #- mv freetype-2.13.3 freetype
# event
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/libevent-2.1.12-stable.tar.gz | tar zfx -
- mv libevent-2.1.12-stable event
# irrlicht
- ./.ci/prepare-irrlicht.sh
# miniaudio
#- ./.ci/prepare-miniaudio.sh
# premake # premake
- cp -rf premake/* .; - cp -rf premake/* .;
artifacts: artifacts:
...@@ -29,6 +36,9 @@ mat_common: ...@@ -29,6 +36,9 @@ mat_common:
- lua - lua
#- freetype #- freetype
- sqlite3 - sqlite3
- event
- irrlicht
#- miniaudio
mat_submodules: mat_submodules:
stage: prepare stage: prepare
...@@ -44,21 +54,29 @@ mat_submodules: ...@@ -44,21 +54,29 @@ mat_submodules:
- ocgcore - ocgcore
- script - script
mat_linux: #mat_linux:
# stage: prepare
# tags:
# - linux
# image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
# script:
# - apt update; apt -y install git wget tar
# - ./.ci/prepare-irrlicht.sh
# artifacts:
# paths:
# - irrlicht
mat_macos:
stage: prepare stage: prepare
tags: tags:
- linux - linux
script: script:
- apt update; apt -y install git wget tar - apt update; apt -y install wget tar
- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht - wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-macosx.tar.gz | tar zfx -
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-linux.tar.gz | tar zfx - - chmod +x premake5
# - env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
artifacts: artifacts:
paths: paths:
# - premake5 - premake5
- irrlicht
# - libevent-stable
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
mat_windows: mat_windows:
stage: prepare stage: prepare
...@@ -67,30 +85,23 @@ mat_windows: ...@@ -67,30 +85,23 @@ mat_windows:
script: script:
- apt update; apt -y install wget tar patch p7zip-full - apt update; apt -y install wget tar patch p7zip-full
# premake5.exe # premake5.exe
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-windows.zip - wget https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-windows.zip
- 7z x -y premake-5.0.0-beta5-windows.zip - 7z x -y premake-5.0.0-beta6-windows.zip
# event
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- mv libevent-2.0.22-stable event
# irrlicht
# - git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
artifacts: artifacts:
paths: paths:
- premake5.exe - premake5.exe
- event
# - irrlicht
._exec_build: ._exec_build:
stage: build stage: build
#variables: #variables:
# NO_LUA_SAFE: '1' # on client no lua safe # NO_LUA_SAFE: '1' # on client no lua safe
cache: #cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" # key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths: # paths:
- bin/ # - bin/
- obj/ # - obj/
exec_windows: .exec_windows:
extends: ._exec_build extends: ._exec_build
tags: tags:
- vs - vs
...@@ -98,56 +109,125 @@ exec_windows: ...@@ -98,56 +109,125 @@ exec_windows:
- mat_common - mat_common
- mat_windows - mat_windows
- mat_submodules - mat_submodules
script: before_script:
- bash -c 'cp -rf premake/* . ; cp -rf resource/* .' - bash -c 'cp -rf premake/* . ; cp -rf resource/* .'
- '.\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'
- copy bin\release\ygopro.exe .
artifacts: artifacts:
paths: paths:
- ygopro.exe - dist
exec_linux: exec_windows:
extends: .exec_windows
script:
- '.\premake5.exe vs2019 --server-zip-support'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release /p:Platform=x64'
- mkdir dist
- mkdir dist\windows
- copy bin\release\x64\ygopro.exe dist\windows\ygopro.exe
.exec_unix_common:
extends: ._exec_build extends: ._exec_build
tags: variables:
- linux RELEASE_DIR: ''
dependencies: TARGET_FILE: ygopro
- mat_common PREMAKE5_BIN: premake5
- mat_linux
- mat_submodules
script: script:
- apt update; apt -y install git build-essential - ./.ci/configure-libevent.sh
- premake5 gmake --build-sqlite --server-zip-support - $PREMAKE5_BIN gmake
- cd build - cd build
- make config=release -j$(nproc) - make config=release -j$(nproc)
- cd .. - cd ..
- mv bin/release/ygopro ./ygopro - mkdir -p dist/$RELEASE_DIR
- strip ygopro - mv bin/release/$TARGET_FILE dist/$RELEASE_DIR/$TARGET_FILE
- |
if [ "$TARGET_FILE" = "ygopro" ]; then
strip dist/$RELEASE_DIR/$TARGET_FILE
fi
artifacts: artifacts:
paths: paths:
- ygopro - dist
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
exec_debian: .exec_linux_common:
extends: ._exec_build extends: .exec_unix_common
tags: tags:
- linux - linux
image: git-registry.moenext.com/mycard/docker-ygopro-builder
dependencies:
- mat_common
#- mat_linux
- mat_submodules
.exec_linux:
extends: .exec_linux_common
variables:
BUILD_SQLITE: '1'
SERVER_ZIP_SUPPORT: '1'
RELEASE_DIR: linux-x64
.exec_debian:
extends: .exec_linux_common
variables:
LUA_DEB: '1'
RELEASE_DIR: debian-x64
before_script:
- apt update; apt -y install git build-essential liblua5.4-dev libsqlite3-dev libevent-dev
.use_arm:
image: git-registry.moenext.com/mycard/docker-ygopro-builder:fpic
tags:
- arm
exec_linux:
extends: .exec_linux
tags:
- noavx2
exec_debian:
extends: .exec_debian
.exec_macos_platform:
extends: .exec_unix_common
dependencies: dependencies:
- mat_common - mat_common
- mat_linux - mat_macos
- mat_submodules - mat_submodules
variables:
PREMAKE5_BIN: ./premake5
BUILD_SQLITE: '1'
BUILD_EVENT: '1'
SERVER_ZIP_SUPPORT: '1'
before_script:
- rm -rf sqlite3/VERSION sqlite3/version
exec_macos_x64:
extends: .exec_macos_platform
tags:
- macos
variables:
RELEASE_DIR: macos-x64
exec_macos_arm64:
extends: .exec_macos_platform
tags:
- macos-m1
variables:
RELEASE_DIR: macos-arm64
exec_macos:
stage: combine
tags:
- macos
dependencies:
- exec_macos_x64
- exec_macos_arm64
script: script:
- apt update; apt -y install git build-essential liblua5.3-dev libsqlite3-dev libevent-dev - mkdir -p dist/macos
- premake5 gmake --lua-deb - lipo -create -output dist/macos/ygopro dist/macos-x64/ygopro dist/macos-arm64/ygopro
- cd build - rm -rf dist/macos-x64 dist/macos-arm64
- make config=release -j$(nproc)
- cd ..
- mv bin/release/ygopro ./ygopro
- strip ygopro
artifacts: artifacts:
paths: paths:
- ygopro - dist
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
#win_server_pack: #win_server_pack:
# stage: pack # stage: pack
...@@ -158,3 +238,18 @@ exec_debian: ...@@ -158,3 +238,18 @@ exec_debian:
# script: # script:
# - apt update; apt -y install p7zip-full wget # - apt update; apt -y install p7zip-full wget
# - wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-win-x64.7z # - wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-win-x64.7z
upload_to_minio:
stage: deploy
dependencies:
- exec_windows
- exec_linux
- exec_debian
- exec_macos
tags:
- linux
script:
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/ s3://mycard/ygopro-server-builds
only:
- server
- tags
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