mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 16:22:47 +01:00
CI: upload builds to builds.citra-emu.org instead of MEGA
This commit is contained in:
parent
b56829df02
commit
6cc1a07235
6 changed files with 65 additions and 48 deletions
6
.travis-build.sh
Normal file → Executable file
6
.travis-build.sh
Normal file → Executable file
|
@ -4,13 +4,13 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
#if OS is linux or is not set
|
#if OS is linux or is not set
|
||||||
if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then
|
if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake -DUSE_QT5=OFF ..
|
cmake -DUSE_QT5=OFF ..
|
||||||
make -j4
|
make -j4
|
||||||
elif [ "$TRAVIS_OS_NAME" = osx ]; then
|
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
export Qt5_DIR=$(brew --prefix)/opt/qt5
|
export Qt5_DIR=$(brew --prefix)/opt/qt5
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake .. -GXcode
|
cmake .. -GXcode
|
||||||
xcodebuild
|
xcodebuild -configuration Release
|
||||||
fi
|
fi
|
||||||
|
|
4
.travis-deps.sh
Normal file → Executable file
4
.travis-deps.sh
Normal file → Executable file
|
@ -4,7 +4,7 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
#if OS is linux or is not set
|
#if OS is linux or is not set
|
||||||
if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then
|
if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
sudo apt-get -qq install g++-4.9 xorg-dev libglu1-mesa-dev libxcursor-dev
|
sudo apt-get -qq install g++-4.9 xorg-dev libglu1-mesa-dev libxcursor-dev
|
||||||
|
@ -23,7 +23,7 @@ if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then
|
||||||
sudo mkdir -p /usr/local
|
sudo mkdir -p /usr/local
|
||||||
curl http://www.cmake.org/files/v2.8/cmake-2.8.11-Linux-i386.tar.gz \
|
curl http://www.cmake.org/files/v2.8/cmake-2.8.11-Linux-i386.tar.gz \
|
||||||
| sudo tar -xz -C /usr/local --strip-components=1
|
| sudo tar -xz -C /usr/local --strip-components=1
|
||||||
elif [ "$TRAVIS_OS_NAME" = osx ]; then
|
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
brew tap homebrew/versions
|
brew tap homebrew/versions
|
||||||
brew install qt5 glfw3 pkgconfig
|
brew install qt5 glfw3 pkgconfig
|
||||||
fi
|
fi
|
||||||
|
|
29
.travis-upload.sh
Normal file
29
.travis-upload.sh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
if [ "$TRAVIS_BRANCH" = "master" ]; then
|
||||||
|
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
|
||||||
|
GITREV="`git show -s --format='%h'`"
|
||||||
|
|
||||||
|
if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
|
||||||
|
REV_NAME="citra-${GITDATE}-${GITREV}-linux-amd64"
|
||||||
|
UPLOAD_DIR="/citra/nightly/linux-amd64"
|
||||||
|
mkdir "$REV_NAME"
|
||||||
|
|
||||||
|
sudo apt-get -qq install lftp
|
||||||
|
cp build/src/citra/citra "$REV_NAME"
|
||||||
|
cp build/src/citra_qt/citra-qt "$REV_NAME"
|
||||||
|
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
|
REV_NAME="citra-${GITDATE}-${GITREV}-osx-amd64"
|
||||||
|
UPLOAD_DIR="/citra/nightly/osx-amd64"
|
||||||
|
mkdir "$REV_NAME"
|
||||||
|
|
||||||
|
brew install lftp
|
||||||
|
cp build/src/citra/Release/citra "$REV_NAME"
|
||||||
|
cp -r build/src/citra_qt/Release/citra-qt.app "$REV_NAME"
|
||||||
|
|
||||||
|
# move qt libs into app bundle for deployment
|
||||||
|
$(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ARCHIVE_NAME="${REV_NAME}.tar.xz"
|
||||||
|
tar -cJvf "$ARCHIVE_NAME" "$REV_NAME"
|
||||||
|
lftp -c "open -u citra-builds,$BUILD_PASSWORD sftp://builds.citra-emu.org; put -O '$UPLOAD_DIR' '$ARCHIVE_NAME'"
|
||||||
|
fi
|
|
@ -4,8 +4,15 @@ os:
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: "AXHFIafTmbGDsHD3mUVj5a4I397DQjti/WoqAJGUp2PglxTcc04BwxZ9Z+xLuf5N2Hs5r9ojAJLT8OGxJCLBDXzneQTNSqXbFuYSLbqrEAiIRlA9eRIotWCg+wYcO+5e8MKX+cHVKwiIWasUB21AtCdq6msh6Y3pUshZp212VPg="
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sh .travis-deps.sh
|
- sh .travis-deps.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sh .travis-build.sh
|
- sh .travis-build.sh
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- sh .travis-upload.sh
|
||||||
|
|
39
appveyor.yml
39
appveyor.yml
|
@ -6,10 +6,8 @@ clone_depth: 5
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
QTDIR: C:\Qt\5.4\msvc2013_64_opengl
|
QTDIR: C:\Qt\5.4\msvc2013_64_opengl
|
||||||
MEGA_EMAIL:
|
BUILD_PASSWORD:
|
||||||
secure: rEo9CGAYX87GKTqZCZ9vLCNCNqxO5JLgbERaHF3YJWg=
|
secure: EXGNlWKJsCtbeImEJ5EP9qrxZ+EqUFfNy+CP61nDOMA=
|
||||||
MEGA_PASSWORD:
|
|
||||||
secure: zE1zmgjS/6GfN/19ROl/O0fVR58svORQ5gdtsxI7J8k=
|
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
- x64
|
- x64
|
||||||
|
@ -27,11 +25,6 @@ before_build:
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
||||||
after_build:
|
after_build:
|
||||||
# upload the build to Mega
|
|
||||||
- cinst wget -x86
|
|
||||||
- wget -q http://megatools.megous.com/builds/megatools-1.9.94-win64.zip
|
|
||||||
# extract megatools silently. See http://stackoverflow.com/a/11629736/1748450
|
|
||||||
- 7z x megatools-1.9.94-win64.zip | FIND /V "ing "
|
|
||||||
# copy the qt dlls
|
# copy the qt dlls
|
||||||
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\icudt53.dll build\bin\release
|
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\icudt53.dll build\bin\release
|
||||||
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\icuin53.dll build\bin\release
|
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\icuin53.dll build\bin\release
|
||||||
|
@ -42,9 +35,25 @@ after_build:
|
||||||
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\Qt5Widgets.dll build\bin\release
|
- copy C:\Qt\5.4\msvc2013_64_opengl\bin\Qt5Widgets.dll build\bin\release
|
||||||
- mkdir build\bin\release\platforms\
|
- mkdir build\bin\release\platforms\
|
||||||
- copy C:\Qt\5.4\msvc2013_64_opengl\plugins\platforms\qwindows.dll build\bin\release\platforms
|
- copy C:\Qt\5.4\msvc2013_64_opengl\plugins\platforms\qwindows.dll build\bin\release\platforms
|
||||||
# zip up the build folder -> build.7z
|
|
||||||
- 7z a build .\build\bin\release\*
|
- ps: >
|
||||||
# rename, upload to Mega
|
if (!"$env:APPVEYOR_PULL_REQUEST_TITLE" -and ("$env:APPVEYOR_REPO_BRANCH" -eq "master"))
|
||||||
- npm install sanitize-filename
|
{
|
||||||
- cd megatools-1.9.94-win64
|
$GITDATE = $(git show -s --date=short --format='%ad') -replace "-",""
|
||||||
- node ..\upload_to_mega.js
|
$GITREV = git show -s --format='%h'
|
||||||
|
$BUILD_NAME = "citra-${GITDATE}-${GITREV}-windows-amd64.7z"
|
||||||
|
# zip up the build folder
|
||||||
|
7z a $BUILD_NAME .\build\bin\release\*
|
||||||
|
|
||||||
|
# download winscp
|
||||||
|
Invoke-WebRequest "http://hivelocity.dl.sourceforge.net/project/winscp/WinSCP/5.7/winscp570.zip" -OutFile "winscp570.zip"
|
||||||
|
7z e -y winscp570.zip
|
||||||
|
|
||||||
|
# upload to server
|
||||||
|
.\WinSCP.com /command `
|
||||||
|
"option batch abort" `
|
||||||
|
"option confirm off" `
|
||||||
|
"open sftp://citra-builds:${env:BUILD_PASSWORD}@builds.citra-emu.org -hostkey=*" `
|
||||||
|
"put $BUILD_NAME /citra/nightly/windows-amd64/" `
|
||||||
|
"exit"
|
||||||
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
var util = require('util');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var sanitize = require("sanitize-filename");
|
|
||||||
|
|
||||||
var email = process.env.MEGA_EMAIL;
|
|
||||||
var password = process.env.MEGA_PASSWORD;
|
|
||||||
var sourceFileName = 'build.7z';
|
|
||||||
var dstFileName = process.env.APPVEYOR_REPO_COMMIT.substring(0, 8) + " - " +
|
|
||||||
process.env.APPVEYOR_REPO_COMMIT_MESSAGE.substring(0, 100) + ".7z";
|
|
||||||
dstFileName = sanitize(dstFileName);
|
|
||||||
|
|
||||||
var cmd = util.format('megaput ../%s --path \"/Root/Citra/Windows/%s\" --username=%s --password=%s --no-progress',
|
|
||||||
sourceFileName,
|
|
||||||
dstFileName,
|
|
||||||
email,
|
|
||||||
password);
|
|
||||||
|
|
||||||
// only upload build on master branch, and not on other branches or PRs
|
|
||||||
if (process.env.APPVEYOR_REPO_BRANCH == "master") {
|
|
||||||
console.log("Uploading file " + dstFileName + " to Mega...");
|
|
||||||
exec(cmd, function(error, stdout, stderr) {
|
|
||||||
console.log('stdout: ' + stdout);
|
|
||||||
console.log('stderr: ' + stderr);
|
|
||||||
if (error !== null) {
|
|
||||||
console.log('exec error: ' + error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in a new issue