forked from ataradov/edbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
127 lines (106 loc) · 3.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
language: c
# Currently supported targets
#
# - Linux using Clang
# - Linux using GCC
# - macOS using Clang
# - macOS using GCC
# - Windows (amd64) using MXE cross compiler
matrix:
include:
- os: linux
compiler: clang
env: TARGET=LINUX_CLANG
- os: linux
compiler: gcc
env: TARGET=LINUX_GCC
- os: osx
compiler: clang
env: TARGET=OSX_CLANG
- os: osx
compiler: gcc
env: TARGET=OSX_GCC
- os: linux
compiler: gcc
env: TARGET=WINDOWS
before_install:
# Windows
# =======
#
- if [[ "$TARGET" == "WINDOWS" ]]; then
git clone --branch=v2.5 --depth=1 https://github.com/uic-evl/omicron.git omicron;
sudo apt-get install gcc-mingw-w64
export CC='x86_64-w64-mingw32-gcc -Iomicron/external/include';
export UNAME=Windows;
fi
# Linux
# =====
#
# Installing the libudev-dev dependency is sufficient
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -y update;
sudo apt-get -y install libudev-dev;
fi
script:
- export COMPILER=$CC
- make all
# If build was successful, binaries will automatically be deployed to bintray.
#
# Since we do not want to deploy binaries for pull requests, we have to take
# environment variables provided by Travis CI into account.
#
# We also check the repository slug, since we do not want failed builds for
# forks. If you want binaries deployed to your bintray account, simply replace
# the secured bintray credentials below and modify the bintray REST request to
# match your bintray username, repository and package.
#
#
# Common environment
# ==================
#
# TRAVIS_BUILD_NUMBER 167
# TRAVIS_COMMIT b6b90f7d2e8b7fdd4d1a62b59c7822ea160f9491
# TRAVIS_REPO_SLUG ataradov/edbg
# TRAVIS_SECURE_ENV_VARS true
#
#
# Environment when building master
# ================================
#
# TRAVIS_BRANCH master
# TRAVIS_PULL_REQUEST false
#
#
# Environment when building a different branch
# =============================================
#
# TRAVIS_BRANCH feature/automatic-windows-deployment
# TRAVIS_PULL_REQUEST false
#
#
# Environment when building a pull request
# ========================================
#
# TRAVIS_BRANCH master
# TRAVIS_PULL_REQUEST 104
env:
global:
secure: "qMls/WRhfVRCYS8vT6xyHo3tZqcgByV1sm7WtNUPdD9zlw5mh+jxqfdByHz27AfDtibkbkMvgja761rhRskFd2Ajrq2E6aOEQkPF6sGHruEcwF5emY/DhXvFHra6UaUPcCEDBvE6ge0JO4OFs7XgrtX8cGi8yj2AzDDemTX1reXRdpY5AIsyo7bBQpgqukXz0ySWkJeWL4cnKXA0c6WGVFESNw2yxC+0z+EXpuPvfw+OQYyxi/A67HZP0YgONQanMuTHK35t39wlogLB8XhVxMbWEBjbnGAi69pvTDOrlA3VDKe1ojv/vm3lvs53jg2m1sxz+q+F9NNIl0XOG+/8N9pWkWLhZxDC/hxXnKdbN0XJZgXplBw5XQDJ7dgeNzPDnWK9/eBFA1nacbDNElCJ6V+pIG6WV+triwmX2smUeuDKEBfG/v8EX1jx5B/SlEUrFR/8hvmL4UZKcLs/9NyrOSE79SleBMkb9KDH1aESQ00xND9rn5RAoLF8nFu4WKOlkSDwbmqvyV6lj5Q5evK6NDPNLdZ4jjLOOprkUU5mjeFsEUR7uHcjOvRktkC8zIE2bNkcqcqOXiPAANWunmrENnUHsqxb3Vc8yG4wYMClnuZG2ZjBlsSiQVu2WUpwAcDAaguB30xz9+dmNB6Tmp3aDw3zch6raHbEu/cmW2XUupQ="
after_success:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "ataradov/edbg" ]; then
SOURCE_FILE="edbg";
BINTRAY_VERSION="${TRAVIS_BUILD_NUMBER}";
BINTRAY_DIRECTORY="${TRAVIS_BRANCH}/${BINTRAY_VERSION}";
BINTRAY_FILE="edbg-b${TRAVIS_BUILD_NUMBER}-${TARGET}-${TRAVIS_COMMIT:0:7}";
if [ "$TARGET" == "WINDOWS" ]; then
SOURCE_FILE="$SOURCE_FILE.exe";
BINTRAY_FILE="$BINTRAY_FILE.exe";
fi;
BINTRAY_RESPONSE=`curl -T "${SOURCE_FILE}" "-uataradov:${BINTRAY_DEPLOYMENT_API_KEY}" "https://api.bintray.com/content/ataradov/edbg/travis-ci/${BINTRAY_VERSION}/${BINTRAY_DIRECTORY}/${BINTRAY_FILE}?publish=1&override=1"`;
if [ '{"message":"success"}' == "${BINTRAY_RESPONSE}" ]; then
echo "Artifact published at https://dl.bintray.com/ataradov/edbg/${BINTRAY_DIRECTORY}/${BINTRAY_FILE}";
else
echo "Depolyment to Bintray failed with response ${BINTRAY_RESPONSE}";
exit 1;
fi
fi