Commit d4af3219 authored by nanahira's avatar nanahira

use develop ci

parent cc97b157
Pipeline #37132 failed with stages
in 2 minutes and 42 seconds
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
set -x
set -o errexit
source .ci/asset-branch
# ygopro-database
apt update && apt -y install wget git libarchive-tools
git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database
cp -rf ./ygopro-database/locales/$TARGET_LOCALE/* .
apt update && apt -y install wget git libarchive-tools sqlite3
git clone --depth=1 -b "$ASSET_BRANCH_NAME" https://code.moenext.com/mycard/ygopro-database
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
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
TARGET_PLATFORM=$(arch)
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
./premake5 gmake --cc=clang --build-freetype --build-sqlite --no-use-irrklang
rm -rf sqlite3/VERSION sqlite3/version
./premake5 gmake --cc=clang
cd build
make config=release -j4
make config=release -j$(sysctl -n hw.ncpu)
cd ..
mkdir ygopro-platforms
......
......@@ -5,4 +5,4 @@ set -o errexit
apt update && apt -y install tar git zstd
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
apt update && apt -y install tar git zstd
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
apt update && apt -y install tar git zstd
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() {
echo "$result" | jq .
}
runForDepot win32 zh-CN
runForDepot linux zh-CN
runForDepot darwin zh-CN
runForDepot win32 en-US
runForDepot linux en-US
runForDepot darwin en-US
source .ci/asset-branch
if [[ "$ASSET_BRANCH_NAME" == "develop" ]]; then
echo "This is a pre-release, skipping upload."
else
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:
- linux
script:
# lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.4.4.tar.gz | tar zfx -
- mv lua-5.4.4 lua
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.4.7.tar.gz | tar zfx -
- mv lua-5.4.7 lua
# sqlite3
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3390300.tar.gz | tar zfx -
- mv sqlite-autoconf-3390300 sqlite3
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/sqlite-autoconf-3490100.tar.gz | tar zfx -
- mv sqlite-autoconf-3490100 sqlite3
# freetype
#- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx -
#- mv freetype-2.11.1 freetype
#- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/freetype-2.13.3.tar.gz | tar zfx -
#- 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
- cp -rf premake/* .;
artifacts:
......@@ -29,6 +36,9 @@ mat_common:
- lua
#- freetype
- sqlite3
- event
- irrlicht
#- miniaudio
mat_submodules:
stage: prepare
......@@ -44,21 +54,29 @@ mat_submodules:
- ocgcore
- 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
tags:
- linux
script:
- apt update; apt -y install git wget tar
- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-linux.tar.gz | tar zfx -
# - env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
- apt update; apt -y install wget tar
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-macosx.tar.gz | tar zfx -
- chmod +x premake5
artifacts:
paths:
# - premake5
- irrlicht
# - libevent-stable
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
- premake5
mat_windows:
stage: prepare
......@@ -67,30 +85,23 @@ mat_windows:
script:
- apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-windows.zip
- 7z x -y premake-5.0.0-beta5-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
- wget https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-windows.zip
- 7z x -y premake-5.0.0-beta6-windows.zip
artifacts:
paths:
- premake5.exe
- event
# - irrlicht
._exec_build:
stage: build
#variables:
# NO_LUA_SAFE: '1' # on client no lua safe
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- bin/
- obj/
#cache:
# key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
# paths:
# - bin/
# - obj/
exec_windows:
.exec_windows:
extends: ._exec_build
tags:
- vs
......@@ -98,56 +109,125 @@ exec_windows:
- mat_common
- mat_windows
- mat_submodules
script:
before_script:
- 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:
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
tags:
- linux
dependencies:
- mat_common
- mat_linux
- mat_submodules
variables:
RELEASE_DIR: ''
TARGET_FILE: ygopro
PREMAKE5_BIN: premake5
script:
- apt update; apt -y install git build-essential
- premake5 gmake --build-sqlite --server-zip-support
- ./.ci/configure-libevent.sh
- $PREMAKE5_BIN gmake
- cd build
- make config=release -j$(nproc)
- cd ..
- mv bin/release/ygopro ./ygopro
- strip ygopro
- mkdir -p dist/$RELEASE_DIR
- mv bin/release/$TARGET_FILE dist/$RELEASE_DIR/$TARGET_FILE
- |
if [ "$TARGET_FILE" = "ygopro" ]; then
strip dist/$RELEASE_DIR/$TARGET_FILE
fi
artifacts:
paths:
- ygopro
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
- dist
exec_debian:
extends: ._exec_build
.exec_linux_common:
extends: .exec_unix_common
tags:
- 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:
- mat_common
- mat_linux
- mat_macos
- 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:
- apt update; apt -y install git build-essential liblua5.3-dev libsqlite3-dev libevent-dev
- premake5 gmake --lua-deb
- cd build
- make config=release -j$(nproc)
- cd ..
- mv bin/release/ygopro ./ygopro
- strip ygopro
- mkdir -p dist/macos
- lipo -create -output dist/macos/ygopro dist/macos-x64/ygopro dist/macos-arm64/ygopro
- rm -rf dist/macos-x64 dist/macos-arm64
artifacts:
paths:
- ygopro
image: git-registry.moenext.com/mycard/docker-ygopro-builder:latest
- dist
#win_server_pack:
# stage: pack
......@@ -158,3 +238,18 @@ exec_debian:
# script:
# - apt update; apt -y install p7zip-full wget
# - 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