forked from labapart/gattlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (93 loc) · 3.68 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
language: c
compiler:
- gcc
#Disable Clang for now until we support ARM cross-toolchain - clang
dist: xenial
addons:
apt:
packages:
- gcc-aarch64-linux-gnu
- g++-aarch64-linux-gnu
- libbluetooth-dev
- rpm
- python3-pip
- python3-setuptools
- doxygen
install:
- |
if [ ! -f $PWD/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf ]; then
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
tar xf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
fi
- pip3 install --upgrade cross-sysroot
- pip3 install Sphinx
- pip3 install breathe
script:
# Build default Gattlib - Debug
- mkdir build-debug && pushd build-debug
- cmake -DCMAKE_BUILD_TYPE=Debug .. && make
- popd
# Build and Package default Gattlib - Release
- mkdir build-release && pushd build-release
- cmake -DCMAKE_BUILD_TYPE=Release .. && make && cpack ..
- popd
# Build Gattlib with DBus support - Debug
- mkdir build-dbus-debug && pushd build-dbus-debug
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Debug .. && make
- popd
# Build and Package Gattlib with DBus support - Release
- mkdir build-dbus-release && pushd build-dbus-release
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make && cpack ..
- popd
#
# Setup build for ARM 32-bit
#
# Set environment variables
- export SYSROOT=$PWD/debian-stable-arm
- export CROSS_COMPILE=$PWD/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
# Ensure folder is empty
- rm -Rf $PWD/debian-stable-arm/*
- cross-sysroot --distribution debian --distribution-version stable --architecture armhf --cross-gcc ${CROSS_COMPILE}gcc --build-root $PWD/debian-stable-arm requirements.dep
# Build and Package Gattlib with DBus support - Release - ARM32
- mkdir build-dbus-release-arm32 && pushd build-dbus-release-arm32
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 && cpack ..
- popd
#
# Setup build for ARM 64-bit
#
# Ensure folder is empty
- rm -Rf $PWD/debian-stable-arm64/*
- cross-sysroot --distribution debian --distribution-version stable --architecture arm64 --build-root $PWD/debian-stable-arm64 requirements.dep
# Set environment variables
- export SYSROOT=$PWD/debian-stable-arm64
- export CROSS_COMPILE=aarch64-linux-gnu-
# Build and Package Gattlib with DBus support - Release - ARM64
- mkdir build-dbus-release-arm64 && pushd build-dbus-release-arm64
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 && cpack ..
- popd
after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then ./update-dev-tag.sh; fi
before_deploy:
# Create directory to store the artifacts we want to deploy
- mkdir artifacts
# Copy packages to artifacts
- cp build-release/gattlib_*_x86_64.deb artifacts/
- cp build-release/gattlib_*_x86_64.rpm artifacts/
- cp build-release/gattlib_*_x86_64.zip artifacts/
# Copy DBUS packages to artifacts
- for f in build-dbus-release/gattlib_*; do cp "$f" "`echo $f | sed 's/build-dbus-release\/gattlib_/artifacts\/gattlib_dbus_/'`"; done
# Copy DBUS ARM packages to artifacts
- cp build-dbus-release-arm32/gattlib_*_armhf.deb artifacts/
- cp build-dbus-release-arm32/gattlib_*_armhf.zip artifacts/
# Copy DBUS ARM64 packages to artifacts
- cp build-dbus-release-arm64/gattlib_*_arm64.deb artifacts/
- cp build-dbus-release-arm64/gattlib_*_arm64.zip artifacts/
deploy:
provider: releases
api-key: ${GITHUB_OAUTH_TOKEN}
file_glob: true
file: artifacts/*
skip_cleanup: true
overwrite: true
on:
tags: true