Commit 5bc9e8d1 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/moecube/ygopro

parents 3f30b26e 359d1d74
#!/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"
This diff is collapsed.
language: cpp
os:
- linux
- osx
env:
matrix:
- locale: zh-CN
- locale: en-US
global:
- USE_IRRKLANG: 1
sudo: required
dist: bionic
osx_image: xcode9.4
git:
submodules: false
addons:
ssh_known_hosts:
- github.com
apt:
# sources:
# - ubuntu-toolchain-r-test
packages:
# - gcc-6
# - g++-6
- libfreetype6-dev
- libevent-dev
- libsqlite3-dev
- libirrlicht-dev
- libgl1-mesa-dev
- libglu-dev
- liblua5.3-dev
before_install:
- git submodule update --init --recursive
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc; sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew cask uninstall --force java;
brew install freetype libevent sqlite dylibbundler;
sudo cp -r /usr/local/include/freetype2 ./freetype2;
sudo cp -r /usr/local/include/event2 ./event2;
sudo rm -rf /usr/local/include/*;
sudo cp -r ./freetype2 /usr/local/include/freetype2;
sudo cp -r ./event2 /usr/local/include/event2;
curl --retry 5 --location https://www.lua.org/ftp/lua-5.3.5.tar.gz | tar zfx -;
mv lua-5.3.5/src lua;
cp premake/lua/premake4.lua lua/;
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 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
- git clone --depth=1 https://$IRRKLANG_ACCESS_KEY@github.com/purerosefallen/irrklang
- mv -f irrklang/plugins/ikpmp3 .
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo cp -rf irrklang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so .; fi
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./premake5 gmake --cc=clang; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./premake5 gmake; fi
- cd build
- make config=release ygopro
- cd ..
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv bin/release/ygopro ./; strip ygopro;
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
mkdir -p ygopro.app/Contents/MacOS;
mv bin/release/ygopro ygopro.app/Contents/MacOS;
dylibbundler -x ygopro.app/Contents/MacOS/ygopro -b -d ygopro.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ -cd;
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";
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
echo $CERTIFICATE | base64 --decode --output cert.p12;
security create-keychain -p "" build.keychain; security default-keychain -s build.keychain; security unlock-keychain -p "" build.keychain;
security import cert.p12 -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign;
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain;
codesign --deep --sign "$(security find-identity -v -p codesigning build.keychain | head -1 | grep -o '".*"' | tr -d '"')" ygopro.app;
fi
fi
before_deploy:
- curl --location --retry 5 'https://github.com/moecube/ygopro-database/archive/master.tar.gz'
| tar --strip-components=1 -zxf - ygopro-database-master/locales
- cp locales/${locale}/* .
- mkdir replay
- mkdir pics
- curl --progress-bar --location --retry 5 --output "ygopro-images-${locale}.zip" https://water.mycard.moe:9777/mycard/images/ygopro-images-${locale}.zip
- unzip -q -d pics ygopro-images-${locale}.zip
- curl --location --retry 5 --output 'ygopro-starter-pack-master.zip' https://github.com/moecube/ygopro-starter-pack/archive/master.zip
- unzip -q ygopro-starter-pack-master.zip
- mv ygopro-starter-pack-master/* .
- curl --location --retry 5 --output 'ygopro-sounds-master.zip' https://github.com/moecube/ygopro-sounds/archive/master.zip
- unzip -q ygopro-sounds-master.zip
- cp -rf ygopro-sounds-master/sound .
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar -zcf ygopro-$TRAVIS_TAG-$TRAVIS_OS_NAME-${locale}.tar.gz
--format=posix --exclude='.git*' ygopro.app LICENSE README.md lflist.conf strings.conf
system.conf cards.cdb script textures deck single pics replay sound; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -zcf ygopro-$TRAVIS_TAG-$TRAVIS_OS_NAME-${locale}.tar.gz
--format=posix --exclude='.git*' ygopro LICENSE README.md libIrrKlang.so lflist.conf strings.conf
system.conf cards.cdb script textures deck single pics replay sound; fi
deploy:
provider: releases
file:
- ygopro-$TRAVIS_TAG-$TRAVIS_OS_NAME-${locale}.tar.gz
skip_cleanup: true
on:
tags: true
api-key:
secure: j7YxYAyoQr1albVJIypwloeJXtZMj11FtqmCDyJ8QGiFk2431o0KMNvN1tC2pK/x08ntN5iVzwEfWh7owDSBeu1HDJo7H7w69s5Rt3UfJE4bw5G2RM6PhG8ZQBwIPkXyXULPTjj3YQRFvcPdBusndQVPhFe/staGLa/t+KOzMyw=
branches:
only:
- master
- /\d+\..+/
version: '{build}'
image: Visual Studio 2019
environment:
matrix:
- locale: zh-CN
# - locale: ja-JP
- locale: en-US
irrklang_pro: 1
access_token:
secure: LTri8weHSdlUoXbLVawx5A4JluBWEMf6cfWWt0UeXNn7kV/bkcMEsFTWDgh1mcVy
install:
# fix tar xz
- set PATH=%PATH%;C:\MinGW\msys\1.0\bin
# submodules
- git submodule update --init --recursive
# environment and system dependency
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-windows.zip ; exit 0"
- 7z x premake-5.0.0-alpha14-windows.zip
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz ; exit 0"
- tar xf libevent-2.0.22-stable.tar.gz
- move libevent-2.0.22-stable event
- xcopy /E event\WIN32-Code event\include
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://downloads.sourceforge.net/freetype/freetype-2.10.1.tar.gz ; exit 0"
- tar xf freetype-2.10.1.tar.gz
- move freetype-2.10.1 freetype
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://downloads.sourceforge.net/irrlicht/irrlicht-1.8.4.zip ; exit 0"
- 7z x irrlicht-1.8.4.zip
- md irrlicht
- move irrlicht-1.8.4\source\Irrlicht irrlicht\src
- move irrlicht-1.8.4\include irrlicht\include
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.5.tar.gz ; exit 0"
- tar xf lua-5.3.5.tar.gz
- move lua-5.3.5\src lua
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2020/sqlite-amalgamation-3310100.zip ; exit 0"
- 7z x -y sqlite-amalgamation-3310100.zip
- move sqlite-amalgamation-3310100 sqlite3
- git clone --depth=1 https://%access_token%@github.com/purerosefallen/irrklang
- mv -f irrklang/plugins/ikpmp3 .
# let premake happy
- xcopy /E premake\* .
# patch irrlicht
- patch -p0 < irrlicht\irrlicht.patch
# premake
- premake5 vs2019
configuration: Release
build:
project: build/ygo.sln
parallel: true
after_build:
- mv bin\release\ygopro.exe .
- curl --location --retry 5 https://github.com/moecube/ygopro-database/archive/master.tar.gz | tar --strip-components=1 -zxf - ygopro-database-master/locales
- cp locales/%locale%/* .
- mkdir replay
- mkdir pics
- curl --location --retry 5 --output ygopro-images-%locale%.zip https://water.mycard.moe:9777/mycard/images/ygopro-images-%locale%.zip
- unzip -q -d pics ygopro-images-%locale%.zip
- curl --location --retry 5 --output ygopro-starter-pack-master.zip https://github.com/moecube/ygopro-starter-pack/archive/master.zip
- unzip -q ygopro-starter-pack-master.zip
- mv ygopro-starter-pack-master/* .
- curl --location --retry 5 --output ygopro-sounds-master.zip https://github.com/moecube/ygopro-sounds/archive/master.zip
- unzip -q ygopro-sounds-master.zip
- cp -rf ygopro-sounds-master/sound .
- tar -zcf ygopro-%APPVEYOR_REPO_TAG_NAME%-win32-%locale%.tar.gz --format=posix --exclude='.git*' ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound
test: off
artifacts:
- path: ygopro-$(APPVEYOR_REPO_TAG_NAME)-win32-$(locale).tar.gz
name: ygopro
deploy:
description: 'Automatic build'
provider: GitHub
auth_token: $(access_token)
on:
appveyor_repo_tag: true # deploy on tag push only
branches:
only:
- master
- /\d+\..+/
cache:
- premake-5.0.0-alpha14-windows.zip
- libevent-2.0.22-stable.tar.gz
- freetype-2.10.1.tar.gz
- irrlicht-1.8.4.zip
- lua-5.3.5.tar.gz
- sqlite-amalgamation-3310100.zip
...@@ -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" }
libdirs { "../irrklang/lib/Win32-visualStudio" } if not IRRKLANG_PRO then
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" }
......
This diff is collapsed.
Subproject commit c136cce6eec542313c9676b0dc555b3b3b5eea0a Subproject commit d95c3fdca20aa20f086e8c1a09d2daff8c35837a
...@@ -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
Subproject commit adeaf7f471ecd2aefd88dc895ed2f1d09dafc3c2 Subproject commit eeb867bbcdfed8a128817761f0902194603f647b
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