Commit c2cdc052 authored by nanahira's avatar nanahira

ci

parent a353a95b
#!/bin/bash
set -x
set -o errexit
# ygopro-database
apt update && apt -y install wget git p7zip-full
git clone --depth=1 https://code.mycard.moe/mycard/ygopro-database
cp -rf ./ygopro-database/locales/$TARGET_LOCALE/* .
# ygopro-images
wget -O ygopro-images.zip https://cdn01.moecube.com/images/ygopro-images-${TARGET_LOCALE}.zip
7z x -y -opics ygopro-images.zip
#!/bin/bash
set -x
set -o errexit
# TARGET_LOCALE
apt update && apt -y install tar git
git submodule update --init
mkdir dist replay
tar -zcf dist/ygopro-$CI_COMMIT_REF_NAME-linux-$TARGET_LOCALE.tar.gz --exclude='.git*' ygopro LICENSE README.md libIrrKlang.so lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound windbot bot bot.conf
#!/bin/bash
set -x
set -o errexit
# TARGET_LOCALE
apt update && apt -y install tar git
git submodule update --init
mkdir dist replay
tar -zcf dist/ygopro-$CI_COMMIT_REF_NAME-osx-$TARGET_LOCALE.tar.gz --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
#!/bin/bash
set -x
set -o errexit
# TARGET_LOCALE
apt update && apt -y install tar git
git submodule update --init
mkdir dist replay
tar -zcf dist/ygopro-$CI_COMMIT_REF_NAME-win32-$TARGET_LOCALE.tar.gz --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
#!/bin/bash
set -x
set -o errexit
echo "$MACOS_CERTIFICATE" | base64 --decode --output cert.p12
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" "$MACOS_KEYCHAIN_NAME" || true
security list-keychains -s login.keychain "$MACOS_KEYCHAIN_NAME"
security default-keychain -s "$MACOS_KEYCHAIN_NAME"
security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" "$MACOS_KEYCHAIN_NAME"
security import cert.p12 -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "$MACOS_KEYCHAIN_PASSWORD" "$MACOS_KEYCHAIN_NAME";
CERT_IDENTITY_NAME=$(security find-identity -v -p codesigning $MACOS_KEYCHAIN_NAME | head -1 | grep -o '".*"' | tr -d '"')
/usr/bin/codesign --deep --sign "$CERT_IDENTITY_NAME" ygopro.app
security lock-keychain "$MACOS_KEYCHAIN_NAME"
stages:
- prepare
- build
- sign
- pack
- deploy
variables:
GIT_DEPTH: "1"
USE_IRRKLANG: "1"
mat_lua:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.5.tar.gz | tar zfx -
- mv lua-5.3.5/src lua
- cp premake/lua/premake4.lua lua/;
artifacts:
paths:
- lua
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:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install git wget tar
- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
artifacts:
paths:
- premake5
- irrlicht_linux
mat_macos:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-macosx.tar.gz | tar zfx -
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libirrklang-patched-dylib.tar.gz | tar zfx -
- mkdir irrlicht
- cd irrlicht
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/irrlicht-mycard-mac.tar.gz | tar zfx -
- cd ..
artifacts:
paths:
- libirrklang-patched.dylib
- premake5
- irrlicht
mat_windows:
stage: prepare
tags:
- linux
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-alpha14-windows.zip
- 7z x -y premake-5.0.0-alpha14-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 ; cp -rf event/WIN32-Code/* event/include
# freetype
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.10.1.tar.gz | tar zfx -
- mv freetype-2.10.1 freetype
# sqlite3
- wget https://cdn01.moecube.com/ygopro-build-materials/sqlite-amalgamation-3310100.zip
- 7z x -y sqlite-amalgamation-3310100.zip
- mv sqlite-amalgamation-3310100 sqlite3
# irrlicht
- wget https://cdn01.moecube.com/ygopro-build-materials/irrlicht-1.8.4.zip
- 7z x -y irrlicht-1.8.4.zip
- mv premake/irrlicht .
- mv irrlicht-1.8.4/source/Irrlicht irrlicht/src
- mv irrlicht-1.8.4/include irrlicht/include
artifacts:
paths:
- premake5.exe
- event
- freetype
- sqlite3
- irrlicht
exec_windows:
stage: build
tags:
- vs
dependencies:
- mat_lua
- mat_irrklang
- mat_windows
variables:
irrklang_pro: '1'
cache:
paths:
- bin/
- obj/
script:
- git submodule update --init
- bash -c 'cp -rf premake/* .'
- cmd /C "patch -p0 < irrlicht\irrlicht.patch"
- '.\premake5.exe vs2019'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\ygo.sln /m /p:Configuration=Release'
- copy bin\release\ygopro.exe .
artifacts:
paths:
- ygopro.exe
exec_linux:
stage: build
tags:
- linux
dependencies:
- mat_irrklang
- mat_linux
cache:
paths:
- bin/
- obj/
script:
- apt update; apt -y install git build-essential libfreetype6-dev libevent-dev libsqlite3-dev libgl1-mesa-dev libglu-dev liblua5.3-dev libxxf86vm-dev
- git submodule update --init
- ./premake5 gmake
- cd build
- make config=release -j$(nproc)
- cd ..
- mv bin/release/ygopro .
- strip ygopro
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so .
artifacts:
paths:
- ygopro
- libIrrKlang.so
exec_macos:
stage: build
tags:
- macos
dependencies:
- mat_irrklang
- mat_macos
- mat_lua
cache:
paths:
- bin/
- obj/
script:
- git submodule update --init
- brew install freetype libevent sqlite dylibbundler
- sudo cp -rf irrklang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib/
#- sudo cp -rf irrklang/include /usr/local/include/irrklang
- ./premake5 gmake --cc=clang
- cd build
- make config=release -j4
- cd ..
- mkdir -p ygopro.app/Contents/MacOS ygopro.app/Contents/Frameworks;
- mv bin/release/ygopro.app ygopro.app/Contents/MacOS/ygopro;
# 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;
- mv premake/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" "CFBundleIdentifier" "moe.mycard.ygopro";
artifacts:
paths:
- ygopro.app
#exec_macos_sign:
# stage: sign
# tags:
# - macos
# dependencies:
# - exec_macos
# script: ./.ci/sign-macos.sh
# artifacts:
# paths:
# - ygopro.app
# only:
# - tags
# - gitlabci
assets:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install tar wget
# starter pack
- wget -O - https://code.mycard.moe/mycard/ygopro-starter-pack/-/archive/master/ygopro-starter-pack-master.tar.gz | tar zfx -
- mv ygopro-starter-pack-master/* .
# sound
- wget -O - https://code.mycard.moe/mycard/ygopro-sounds/-/archive/master/ygopro-sounds-master.tar.gz | tar zfx -
- mv ygopro-sounds-master/sound/* sound
# fonts
- mkdir fonts
- cd fonts
- wget -O - https://cdn01.moecube.com/ygopro-fonts.tar.gz | tar zfx -
- cd ..
artifacts:
paths:
- deck
- single
- sound
- fonts
only:
- tags
- gitlabci
assets_nonwindows:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install tar wget
- wget -O - https://cdn01.moecube.com/windbot-mc/windbot.tar.gz | tar zfx -
artifacts:
paths:
- bot.conf
- windbot
- bot
only:
- tags
- gitlabci
assets_windows:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget p7zip-full
- wget https://cdn01.moecube.com/windbot-mc/WindBot.7z
- 7z x -y WindBot.7z
artifacts:
paths:
- bot.conf
- WindBot
- Bot.exe
only:
- tags
- gitlabci
assets_zh-CN:
stage: build
tags:
- linux
script: ./.ci/assets-locale.sh
variables:
TARGET_LOCALE: zh-CN
artifacts:
paths:
- pics
- cards.cdb
- strings.conf
only:
- tags
- gitlabci
assets_en-US:
stage: build
tags:
- linux
script: ./.ci/assets-locale.sh
variables:
TARGET_LOCALE: en-US
artifacts:
paths:
- pics
- cards.cdb
- strings.conf
only:
- tags
- gitlabci
pack_windows_zh-CN:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_windows
- exec_windows
- assets_zh-CN
script: ./.ci/pack-windows.sh
variables:
TARGET_LOCALE: zh-CN
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_windows_zh-CN:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_windows
- exec_windows
- assets_zh-CN
script: ./.ci/pack-windows.sh
variables:
TARGET_LOCALE: zh-CN
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_windows_en-US:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_windows
- exec_windows
- assets_en-US
script: ./.ci/pack-windows.sh
variables:
TARGET_LOCALE: en-US
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_linux_zh-CN:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_nonwindows
- exec_linux
- assets_zh-CN
script: ./.ci/pack-linux.sh
variables:
TARGET_LOCALE: zh-CN
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_linux_en-US:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_nonwindows
- exec_linux
- assets_en-US
script: ./.ci/pack-linux.sh
variables:
TARGET_LOCALE: en-US
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_macos_zh-CN:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_nonwindows
- exec_macos
- assets_zh-CN
script: ./.ci/pack-macos.sh
variables:
TARGET_LOCALE: zh-CN
artifacts:
paths:
- dist
only:
- tags
- gitlabci
pack_macos_en-US:
stage: pack
tags:
- linux
dependencies:
- assets
- assets_nonwindows
- exec_macos
- assets_en-US
script: ./.ci/pack-macos.sh
variables:
TARGET_LOCALE: en-US
artifacts:
paths:
- dist
only:
- tags
- gitlabci
upload_to_minio:
stage: deploy
dependencies:
- pack_windows_zh-CN
- pack_linux_zh-CN
- pack_macos_zh-CN
- pack_windows_en-US
- pack_linux_en-US
- pack_macos_en-US
tags:
- linux
image: python
script:
- pip install -U -i https://mirrors.aliyun.com/pypi/simple/ awscli
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync dist/ s3://mycard/mcpro
only:
- tags
- gitlabci
...@@ -46,7 +46,7 @@ before_install: ...@@ -46,7 +46,7 @@ before_install:
cp premake/lua/premake4.lua lua/; cp premake/lua/premake4.lua lua/;
fi fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir irrlicht ; cd irrlicht ; curl --retry 5 --location https://github.com/moecube/irrlicht/releases/download/test/irrlicht-mycard-mac.tar.gz | tar zfx - ; cp libIrrlicht.a /usr/local/lib/ ; sudo cp -r include /usr/local/include/irrlicht ; cd .. ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir irrlicht ; cd irrlicht ; curl --retry 5 --location https://github.com/moecube/irrlicht/releases/download/test/irrlicht-mycard-mac.tar.gz | tar zfx - ; cd .. ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl --retry 5 --location https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-macosx.tar.gz | tar zfx -; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl --retry 5 --location https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-macosx.tar.gz | tar zfx -; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl --retry 5 --location https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-linux.tar.gz | tar zfx - ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl --retry 5 --location https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-linux.tar.gz | tar zfx - ; fi
......
...@@ -24,9 +24,19 @@ project "ygopro" ...@@ -24,9 +24,19 @@ project "ygopro"
links { "lua" } links { "lua" }
if USE_IRRKLANG then if USE_IRRKLANG then
links { "irrKlang" } links { "irrKlang" }
if not IRRKLANG_PRO then
libdirs { "../irrklang/lib/Win32-visualStudio" } libdirs { "../irrklang/lib/Win32-visualStudio" }
end end
end
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" } links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
if IRRKLANG_PRO then
configuration { "windows", "not vs2017", "not vs2019" }
libdirs { "../irrklang/lib/Win32-visualStudio" }
configuration { "windows", "vs2017" }
libdirs { "../irrklang/lib/Win32-vs2017" }
configuration { "windows", "vs2019" }
libdirs { "../irrklang/lib/Win32-vs2019" }
end
configuration {"windows", "not vs*"} configuration {"windows", "not vs*"}
includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" } includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" }
configuration "not vs*" configuration "not vs*"
...@@ -34,9 +44,12 @@ project "ygopro" ...@@ -34,9 +44,12 @@ project "ygopro"
configuration "not windows" configuration "not windows"
includedirs { "/usr/include/irrlicht", "/usr/include/freetype2" } includedirs { "/usr/include/irrlicht", "/usr/include/freetype2" }
excludes { "COSOperator.*" } excludes { "COSOperator.*" }
links { "event_pthreads", "GL", "dl", "pthread" } links { "event_pthreads", "dl", "pthread" }
configuration { "not windows", "not macosx" }
links "GL"
configuration "linux" configuration "linux"
links { "lua5.3-c++" } includedirs { "../irrlicht_linux/include" }
links { "X11", "Xxf86vm", "lua5.3-c++" }
if USE_IRRKLANG then if USE_IRRKLANG then
links { "IrrKlang" } links { "IrrKlang" }
linkoptions{ "-Wl,-rpath=./" } linkoptions{ "-Wl,-rpath=./" }
...@@ -44,6 +57,8 @@ project "ygopro" ...@@ -44,6 +57,8 @@ project "ygopro"
end end
configuration "macosx" configuration "macosx"
links { "lua" } links { "lua" }
includedirs { "../irrlicht/include" }
libdirs { "../irrlicht" }
if USE_IRRKLANG then if USE_IRRKLANG then
links { "irrklang" } links { "irrklang" }
libdirs { "../irrklang/bin/macosx-gcc" } libdirs { "../irrklang/bin/macosx-gcc" }
......
...@@ -32,9 +32,9 @@ solution "ygo" ...@@ -32,9 +32,9 @@ solution "ygo"
libdirs { "/usr/local/lib" } libdirs { "/usr/local/lib" }
configuration "macosx" configuration "macosx"
defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53"} defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53", "GL_SILENCE_DEPRECATION" }
includedirs { "/usr/local/include", "/usr/local/include/*" } includedirs { "/usr/local/include/event2", "/usr/local/include/freetype2", "/usr/local/opt/sqlite3/include" }
libdirs { "/usr/local/lib", "/usr/X11/lib" } libdirs { "/usr/local/lib", "/usr/local/opt/sqlite3/lib" }
buildoptions { "-stdlib=libc++" } buildoptions { "-stdlib=libc++" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" } links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
...@@ -86,6 +86,9 @@ solution "ygo" ...@@ -86,6 +86,9 @@ solution "ygo"
include "irrlicht" include "irrlicht"
include "sqlite3" include "sqlite3"
end end
if os.ishost("linux") then
include "irrlicht_linux"
end
if USE_IRRKLANG then if USE_IRRKLANG then
include "ikpmp3" include "ikpmp3"
end end
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