forked from QW-Group/mvdsv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
93 lines (84 loc) · 2.61 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
dist: trusty
sudo: required
os:
- linux
# in theory travis should detect what to install,
# but we use meson, which is not supported by travis yet and we need custom commands
compiler:
- gcc
language:
- c
env:
global:
DATETIME=$(date +%Y%m%d-%H%M%S)
matrix:
include:
- os: linux
dist: trusty
env:
TARGET=linux-amd64
EXTENSION=
- os: linux
dist: trusty
env:
TARGET=linux-armhf
EXTENSION=
- os: linux
dist: trusty
env:
TARGET=linux-i686
EXTENSION=
- os: linux
dist: trusty
env:
TARGET=windows-x86
EXTENSION=.exe
- os: linux
dist: trusty
env:
TARGET=windows-x64
EXTENSION=.exe
before_install:
# show some extra info
- export | sort
- env | sort
# update base distro
- sudo apt-get update
# install base packages
- sudo apt-get -y install build-essential python-virtualenv python3-dev python3-pip ninja-build cmake gcc-multilib
# ensure we do not have curl dev libs, otherwise it caused cross compilations to fail
- sudo apt-get -y remove libcurl.*-dev
- sudo apt-get -y remove libpcre*-dev
# install cross complier if we gonna do binaries for windows
- if [ -z "${TARGET##*win*}" ]; then sudo apt-get -y install mingw-w64 ; fi
# install cross compiler tools if we gonna do binares for arm/raspberry
# notice it will remove gcc-multilib
- if [ -z "${TARGET##*arm*}" ]; then sudo apt-get -y install gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf ;fi
# activate virtualenv with python3, meson requires python3
- virtualenv .venv --python=python3
- . .venv/bin/activate
- pip3 install --upgrade pip
# install python packages like meson, ninja etc...
- pip3 install -r requirements.txt
# each script section is executed in matrix build
script:
- echo TARGET=${TARGET}
- mkdir build_${TARGET} || true
- meson build_${TARGET} --cross-file tools/cross-compilation/${TARGET}.txt
- ninja -v -C build_${TARGET}
# print basic info about compiled files
- file build_${TARGET}/mvdsv${EXTENSION}
- mkdir -p uploads_to_gcs
- mv build_${TARGET}/mvdsv${EXTENSION} uploads_to_gcs/${DATETIME}_${TRAVIS_COMMIT:0:7}_mvdsv${EXTENSION}
deploy:
provider: gcs
access_key_id: GOOGIDU6SZSRYABCDMPF
secret_access_key:
secure: "Mz9ekafJMVUEjWeKA7hK+4UhDRyp74cZgAcWXozO54jb/NyyfzZWthr3Lu/41LwXrcSVWGruQTrcAvBt3jzm+v9X2lCAnBOENisbBu/HegCAdMt2XTRud9lisaL5IMiPIaA4sAPjlfkkHo9yxQqzXhF2/IqOiNYiDcUAKeXcvLY="
bucket: mvdsv
on:
repo: deurk/mvdsv
skip_cleanup: true
upload-dir: commits/${TARGET}
local-dir: uploads_to_gcs
acl: public-read