forked from matusnovak/simplesquirrel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
64 lines (64 loc) · 2.88 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- cmake
env:
- ARCH=x86_64
- TOOLSET=linux-gnu
- os: osx
osx_image: xcode6.4
addons:
apt:
sources:
- llvm-toolchain-precise-3.7
packages:
- cmake
- clang-3.7
env:
- ARCH=x86_64
- TOOLSET=apple-darwin
before_script:
- curl -k -o next_git_tag.sh https://gist.githubusercontent.com/matusnovak/eba81343f5578c38cf0a9bc22b548727/raw/1678041e118a77c3083216cbf55bcf7b46e02e38/next_git_tag.sh
- chmod +x ./next_git_tag.sh
- git submodule init
- git submodule update
script:
- export CURRENT_BRANCH=$TRAVIS_BRANCH
- if [ $TRAVIS_OS_NAME == linux ]; then sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-5 /usr/bin/g++; fi
- gcc --version
- g++ --version
- mkdir build
- cd build && (cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=MinSizeRel || travis_terminate 1) && cd ..
- cd build && (make install || travis_terminate 1) && cd ..
- cd build && (ctest --verbose -C MinSizeRel -E "test_gl" || travis_terminate 1) && cd ..
- export GCC_MACHINE=$(gcc -dumpmachine)
- export GCC_VERSION=$(gcc -dumpversion)
- cd install && zip -r "../simplesquirrel-$GCC_MACHINE-$GCC_VERSION.zip" * && cd ..
- if [ $TRAVIS_OS_NAME == linux ]; then wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2; fi
- if [ $TRAVIS_OS_NAME == osx ]; then wget https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2; fi
- if [ $TRAVIS_OS_NAME == linux ]; then tar -xvjf linux-amd64-github-release.tar.bz2 && cp ./bin/linux/amd64/github-release . ; fi
- if [ $TRAVIS_OS_NAME == osx ]; then tar -xvjf darwin-amd64-github-release.tar.bz2 && cp ./bin/darwin/amd64/github-release . ; fi
- export COMMIT_MESSAGE=$(git log -1 --pretty=%B)
- source ./next_git_tag.sh
- export GITHUB_PROJECT_USERNAME=${TRAVIS_REPO_SLUG%/*}
- export GITHUB_PROJECT_REPONAME=${TRAVIS_REPO_SLUG#*/}
- if [ $TRAVIS_BRANCH == master ]; then ./github-release release --user $GITHUB_PROJECT_USERNAME --repo $GITHUB_PROJECT_REPONAME --tag $GITHUB_RELEASE_TAG --name "Compiled - $GITHUB_RELEASE_TAG" --description "$COMMIT_MESSAGE" || true; fi
- if [ $TRAVIS_BRANCH == master ]; then ./github-release upload --user $GITHUB_PROJECT_USERNAME --repo $GITHUB_PROJECT_REPONAME --tag $GITHUB_RELEASE_TAG --replace --name simplesquirrel-$GCC_MACHINE-$GCC_VERSION.zip --file simplesquirrel-$GCC_MACHINE-$GCC_VERSION.zip || travis_terminate 1; fi
branches:
only:
- master
- devel
notifications:
email:
recipients:
on_success: always
on_failure: always