Activates an automatic pre-release and binary upload from Travis.

This commit is contained in:
xawotihs
2013-12-05 21:21:08 +01:00
parent bf0a0a1580
commit ae97abbf96
4 changed files with 57 additions and 17 deletions

View File

@@ -1,17 +1,22 @@
language: cpp
before_install:
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
- export ANDROID="android-sdk-linux/tools/android"
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
- export ANDROID="android-sdk-linux/tools/android"
install:
- sudo apt-get update -qq
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
- tar -x --xz -f sdk.lzma
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
- tar -zxf android-sdk_r22-linux.tgz
- echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt
script: "./travis-script.sh"
- sudo apt-get update -qq
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm
ia32-libs ia32-libs-multiarch; fi
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
- tar -x --xz -f sdk.lzma
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
- tar -zxf android-sdk_r22-linux.tgz
- echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt
script: ./travis-script.sh
env:
global:
secure: YocijVYZa1oDPviFubPIpmBmXyw0gQ7D0YA6tC01wExXvY+8tGUh1HQ5uXn8LotRZ+Ob5HLHDaCzkKWF8+57ILSMeHrnf6tcRyyeO7wjNY9P7WvSZyCjvqnWzsUN9tiMmsEzhTz2MaUgsY6ocB/4nbWZwfQvL7z+s7z41R4J1I4=
after_success: ./upload-binaries.sh

View File

@@ -2,6 +2,7 @@
<!-- build.properties should contain the values for major, minor and point -->
<property file="build.properties" />
<property file="build.number.properties" />
<property environment="env"/>
<path id="groovy.class.path" >
<fileset dir="${groovy.dir}" />
@@ -76,15 +77,16 @@ Author: Michael Nguyen
#define WAGIC_VERSION_MAJOR ${build.major}
#define WAGIC_VERSION_MEDIUM ${build.minor}
#define WAGIC_VERSION_MINOR ${build.point}
#define WAGIC_VERSION_REVISION ${env.TRAVIS_BUILD_NUMBER}
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_DOT(a, b, c, d) a ##.## b ##.## c ##.## d
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c)
#define VERSION_GAME(a, b, c, d) VERSION_DOT(a, b, c, d)
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
#define VERSION_TOSTRING(a) #a
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR, WAGIC_VERSION_REVISION)
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)

View File

@@ -1,5 +1,10 @@
#!/bin/sh -ex
# updating versions with the TRAVIS build numbers
cd projects/mtg/
ant update
cd ../..
# we're building a PSP binary here
cd JGE
make -j 8

28
upload-binaries.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/sh -ex
if [ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "ci_upload_binaries"]; then
echo -e "Creating a release\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" -d '{"tag_name": "pre-release-${TRAVIS_BUILD_NUMBER}", "target_commitish": "master", "name": "pre-release-${TRAVIS_BUILD_NUMBER}", "body": "Automatic pre-release ${TRAVIS_BUILD_NUMBER}", "draft": true, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases"
#copy data we're interested in to other place
cp -R coverage $HOME/coverage
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Uko/Rubidium-WHOIS.git gh-pages > /dev/null
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/coverage/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages > /dev/null
echo -e "Done magic with coverage\n"
fi