forked from JCMais/node-libcurl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (103 loc) · 3.48 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
os:
- linux
- osx
language: cpp
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- openssl
env:
global:
- GCC_VERSION=4.8
- DEBUG="node-libcurl"
- secure: d64E8XbVGHuQ0kls1oVUF1y6pnj3iqZB34roKBHAFTyWBXReC1FWLb+qEShCJicUDkeK2At7vQUz7ohMn2mL/hVXiRbuSaYuDKFx8iDeei9mTgE+iy258mSovnNvXfG72EP5+LB+UOhgmTGe0qyTALOQ6ceCgjdscul3IGWE8lw=
matrix:
- TRAVIS_NODE_VERSION="0.10" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="0.12" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="iojs-3" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="4" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="5" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="0.10" LIBCURL_VERSION_TAG="curl-7_30_0"
- TRAVIS_NODE_VERSION="0.12" LIBCURL_VERSION_TAG="curl-7_30_0"
- TRAVIS_NODE_VERSION="iojs-3" LIBCURL_VERSION_TAG="curl-7_30_0"
- TRAVIS_NODE_VERSION="4" LIBCURL_VERSION_TAG="curl-7_30_0"
- TRAVIS_NODE_VERSION="5" LIBCURL_VERSION_TAG="curl-7_30_0"
cache:
directories:
- $HOME/curl-source
git:
submodules: false
before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export CC=/usr/bin/gcc-${GCC_VERSION};
export CXX=/usr/bin/g++-${GCC_VERSION};
fi;
# update openssl on mac
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew update;
brew install openssl;
brew link --force openssl;
fi;
- export PATH=$HOME/bin:$PATH
- rm -rf ~/.nvm
- git clone https://github.com/creationix/nvm.git ~/.nvm
- source ~/.nvm/nvm.sh
- nvm install $TRAVIS_NODE_VERSION
- npm install npm
- mv node_modules npm
- export PATH="./node_modules/.bin/:$PATH"
# output versions
- npm/.bin/npm --version
- node --version
- node tools/curl-config.js
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then apt-cache policy openssl; fi;
- openssl version -a
- if [[ $LIBCURL_VERSION_TAG == 'LATEST' ]]; then
TAG=$( git ls-remote --tags https://github.com/bagder/curl.git |
awk '{print $2}' | grep 'curl-' | grep -v '[0-9][_-][abp]' |
grep -v '{' | sort -t_ -k 1.16,1n -k 2,2n -k 3,3n -k 4,4n |
sed -n 's@.*\(curl-[0-9_]\)@\1@p' | tail -n1 );
else
TAG=${LIBCURL_VERSION_TAG};
fi;
- mkdir -p $HOME/curl-source
- cd $HOME/curl-source
- if [[ ! -d "$TAG" ]]; then
git clone --branch "$TAG" --depth 1 https://github.com/bagder/curl.git "$TAG";
fi;
- cd "$TAG"
- ./buildconf && ./configure --prefix=$HOME && make && make install
- cd $TRAVIS_BUILD_DIR
# output curl version info
- curl --version
- curl-config --version
- curl-config --features
- curl-config --protocols
- PUBLISH_BINARY=false
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` || ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then
PUBLISH_BINARY=true;
fi;
install:
- npm/.bin/npm install --build-from-source --loglevel=http
- npm/.bin/npm test
before_script:
- if [[ $PUBLISH_BINARY == true && $LIBCURL_VERSION_TAG == LATEST ]]; then
node-pre-gyp package testpackage --verbose;
node scripts/module-packaging.js --publish "$(node-pre-gyp reveal staged_tarball --silent)";
fi;
script:
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then
INSTALL_RESULT=$(npm/.bin/npm install --fallback-to-build=false > /dev/null)$? || true;
fi;
- if [[ $INSTALL_RESULT != 0 ]]; then
node scripts/module-packaging.js --unpublish "$(node-pre-gyp reveal hosted_tarball --silent)";
false;
fi
- node-pre-gyp clean