Commit 3eb82d53 authored by nanahira's avatar nanahira

new ci

parent 47ef239a
#!/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/nanahira/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/KoishiPro-$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 locales fonts
#!/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/KoishiPro-$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 locales fonts
#!/bin/bash
set -x
set -o errexit
# TARGET_LOCALE
apt update && apt -y install tar git
git submodule update --init
mkdir dist replay
ARCHIVE_FILES=(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 locales fonts)
if [[ "$TARGET_LOCALE" == "zh-CN" ]]; then
ARCHIVE_FILES=("${ARCHIVE_FILES[@]}" update-koishipro)
fi
7z a -mx9 -xr!.git* dist/KoishiPro-$CI_COMMIT_REF_NAME-win32-$TARGET_LOCALE.7z "${ARCHIVE_FILES[@]}"
#!/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
sudo: required
dist: bionic
osx_image: xcode10.3
addons:
ssh_known_hosts:
- github.com
apt:
packages:
- libfreetype6-dev
- libevent-dev
- libsqlite3-dev
- libgl1-mesa-dev
- libglu-dev
- p7zip-full
- liblua5.3-dev
env:
- USE_IRRKLANG=1
before_install:
- git submodule update --init --recursive
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew cask uninstall --force java;
brew install freetype libevent sqlite dylibbundler p7zip;
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 - ; cd .. ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl --location --retry 5 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
git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux;
curl --location --retry 5 https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -;
fi
- git clone --depth=1 https://$NANAHIRA@github.com/purerosefallen/irrklang
- 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:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
7z a -mx9 -xr!.git* KoishiPro-$TRAVIS_OS_NAME-$TRAVIS_TAG.zip ygopro libIrrKlang.so;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
7z a -mx9 -xr!.git* KoishiPro-$TRAVIS_OS_NAME-$TRAVIS_TAG.zip ygopro.app;
fi
- curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://water.mycard.moe:9000/mycard/images/ygopro-images-zh-CN.zip
- 7z x -y -opics ygopro-images-zh-CN.zip > /dev/null
- curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/moecube/ygopro-starter-pack/archive/master.zip
- 7z x -y ygopro-starter-pack-master.zip > /dev/null
- cp -rf ygopro-starter-pack-master/* .
- rm -rf pics/thumbnail pics/*.db
- git clone --depth=1 https://$NANAHIRA@github.com/purerosefallen/fonts
- curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/releases/download/latest/WindBot.7z
- 7z x -y WindBot.7z > /dev/null
- mv -f WindBot windbot
- curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/raw/master/BotWrapper/BotWrapper.sh
- mv -f BotWrapper.sh bot
- chmod +x bot
- cd sound
- bash -c "grep '.wav' files.txt | xargs -I {} curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-222DIY-sound/raw/master/{} ; exit 0"
- cd ..
- git clone --depth=1 https://github.com/purerosefallen/ygopro-database
- mv -f ygopro-database/locales .
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
7z a -mx9 -xr!.git* KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro libIrrKlang.so LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics sound windbot locales bot.conf bot > /dev/null;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
7z a -mx9 -xr!.git* KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip ygopro.app LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures fonts skin deck single pics sound windbot locales bot.conf bot > /dev/null;
fi
deploy:
provider: releases
file:
- KoishiPro-$TRAVIS_OS_NAME-$TRAVIS_TAG.zip
- KoishiPro-$TRAVIS_OS_NAME-full-$TRAVIS_TAG.zip
skip_cleanup: true
overwrite: true
on:
tags: true
api-key: $NANAHIRA
version: '{build}'
image: Visual Studio 2019
environment:
irrklang_pro: 1
access_token:
secure: EQ9miMjfX/QAoBvgc6D+JLmHatLyxOEKZ/uo68QijxWW5Gp4MzB/pOH9+u2GlDVO
install:
- 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 -y 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 -y 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
# let premake happy
- cp -rf premake/* .
# patch irrlicht & ikpmp3
- patch -p0 < irrlicht\irrlicht.patch
# premake
- premake5 vs2019
configuration: Release
build:
project: build/ygo.sln
parallel: true
after_build:
- mv -f bin/release/ygopro.exe .
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/releases/download/latest/WindBot.7z ; exit 0"
- 7z x -y WindBot.7z
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://water.mycard.moe:9000/mycard/images/ygopro-images-zh-CN.zip ; exit 0"
- 7z x -y -opics ygopro-images-zh-CN.zip
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/update-koishipro/archive/master.zip ; exit 0"
- 7z x -y update-koishipro-master.zip
- mv -f update-koishipro-master update-koishipro
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/moecube/ygopro-starter-pack/archive/master.zip ; exit 0"
- 7z x -y ygopro-starter-pack-master.zip
- cp -rf ygopro-starter-pack-master/* .
- cd sound
- bash -c "grep '.wav' files.txt | xargs -I {} curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-222DIY-sound/raw/master/{} ; exit 0"
- cd ..
- rm -rf pics/thumbnail pics/*.db
- git clone --depth=1 https://github.com/purerosefallen/ygopro-database
- mv -f ygopro-database/locales .
- git clone --depth=1 https://%access_token%@github.com/purerosefallen/fonts
- 7z a -mx9 -xr!.git* KoishiPro-%APPVEYOR_REPO_TAG_NAME%.7z ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures skin deck single pics sound update-koishipro locales fonts WindBot Bot.exe bot.conf
test: off
deploy:
description: 'Automatic build commit $(APPVEYOR_REPO_COMMIT) $(APPVEYOR_REPO_COMMIT_TIMESTAMP)'
provider: GitHub
force_update: true
auth_token: $(access_token)
on:
appveyor_repo_tag: true
artifacts:
- path: ygopro.exe
name: ygopro client
- path: KoishiPro-$(APPVEYOR_REPO_TAG_NAME).7z
name: ygopro full repack
cache:
- premake-5.0.0-alpha14-windows.zip
- libevent-2.0.22-stable.tar.gz
- freetype-2.10.1.tar.gz
- lua-5.3.5.tar.gz
- irrlicht-1.8.4.zip
- sqlite-amalgamation-3310100.zip
......@@ -52,7 +52,9 @@ project "ygopro"
configuration "not windows"
includedirs { "/usr/include/freetype2" }
excludes { "COSOperator.*" }
links { "event_pthreads", "GL", "dl", "pthread" }
links { "event_pthreads" , "dl", "pthread" }
configuration { "not windows", "not macosx" }
links "GL"
configuration "linux"
includedirs { "../irrlicht_linux/include" }
links { "X11", "Xxf86vm" }
......
Subproject commit 293e533c28e4f1870444f6071643b81e1c28e639
Subproject commit 53052e1e1e2bfcc77146dc451da24ad585e24baf
......@@ -43,9 +43,9 @@ end
libdirs { "/usr/local/lib" }
configuration "macosx"
defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53" }
includedirs { "/usr/local/include", "/usr/local/include/*" }
libdirs { "/usr/local/lib", "/usr/X11/lib" }
defines { "LUA_USE_MACOSX", "DBL_MAX_10_EXP=+308", "DBL_MANT_DIG=53", "GL_SILENCE_DEPRECATION" }
includedirs { "/usr/local/include/event2", "/usr/local/include/freetype2", "/usr/local/opt/sqlite3/include" }
libdirs { "/usr/local/lib", "/usr/local/opt/sqlite3/lib" }
buildoptions { "-stdlib=libc++" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
......@@ -64,9 +64,7 @@ end
configuration { "Release", "vs*" }
flags { "LinkTimeOptimization" }
if not os.ishost("macosx") then
staticruntime "On"
end
disablewarnings { "4244", "4267", "4838", "4577", "4819", "4018", "4996", "4477", "4091", "4828", "4800" }
configuration { "Release", "not vs*" }
......
Subproject commit adeaf7f471ecd2aefd88dc895ed2f1d09dafc3c2
Subproject commit 7b721c6472ec5adfbfb3ef14c952bf02a1cd5f35
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