forked from JCMais/node-libcurl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
129 lines (128 loc) · 4.4 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
127
128
129
os:
- linux
- osx
osx_image: xcode7.3
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="6" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="8" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="9" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="10" LIBCURL_VERSION_TAG=LATEST
- TRAVIS_NODE_VERSION="6" LIBCURL_VERSION_TAG="curl-7_32_0"
- TRAVIS_NODE_VERSION="8" LIBCURL_VERSION_TAG="curl-7_32_0"
- TRAVIS_NODE_VERSION="9" LIBCURL_VERSION_TAG="curl-7_32_0"
- TRAVIS_NODE_VERSION="10" LIBCURL_VERSION_TAG="curl-7_32_0"
cache:
directories:
- $HOME/curl-source
- $HOME/.node-gyp
- $HOME/.npm
- node_modules
git:
submodules: false
before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export CC="gcc-${GCC_VERSION}";
export CXX="g++-${GCC_VERSION}";
export LINK="gcc-${GCC_VERSION}";
export LINKXX="g++-${GCC_VERSION}";
export LDFLAGS="-Wl,-rpath,${HOME}/lib";
fi
# Update openssl on osx, and add it to the Path
# When configuring openssl should we call ths directly? env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew update;
brew reinstall -s libtool;
brew install openssl;
brew outdated openssl || brew upgrade openssl;
brew link --force openssl;
export PATH=/usr/local/opt/openssl/bin:${PATH};
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig;
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 [email protected]
- mv node_modules npm
- export PATH="./node_modules/.bin/:$PATH"
# output versions
- npm/.bin/npm --version
- node --version
- 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"
- CURL_PREFIX=$HOME
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
CURL_PREFIX=/usr/local;
fi
- ./buildconf && ./configure --prefix=$CURL_PREFIX --with-ssl && make && make install
- cd $TRAVIS_BUILD_DIR
# output curl version info
- curl --version
- curl-config --version
- curl-config --libs
- curl-config --static-libs
- curl-config --prefix
- curl-config --cflags
- 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:
- node tools/curl-config.js --version
- node tools/curl-config.js --libs
- node tools/curl-config.js --static-libs
- node tools/curl-config.js --prefix
- node tools/curl-config.js --cflags
- export PKG_CONFIG_PATH=/home/travis/lib/pkgconfig
- pkg-config --cflags libcurl
- pkg-config --libs libcurl
- npm/.bin/npm install --build-from-source --loglevel=info
- 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