Clean up Travis and automate deployments (#9)

This commit is contained in:
Adam Babik 2017-12-06 09:40:23 +01:00 committed by GitHub
parent 454e46eafd
commit 7da4ba9846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1089 additions and 13 deletions

View File

@ -1,19 +1,29 @@
notifications:
email: false
language: node_js
matrix:
include:
- os: linux
sudo: required
node_js: "8.2.1"
- os: linux
sudo: required
node_js: "8"
- os: osx
language: node_js
node_js:
- "7.9.0" # Current stable Electron version
node_js: "8.2.1"
- os: osx
node_js: "8"
install:
- ./.travis/install.sh
- npm install
- npm run configure
- npm run build
deploy:
provider: script
script: ./.travis/deploy.sh
on:
tags: true

37
.travis/deploy.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# Check out for https://github.com/cloudflare/semver_bash/blob/master/semver.sh
function semverParseInto() {
local RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
#MAJOR
eval $2=`echo $1 | sed -e "s#$RE#\1#"`
#MINOR
eval $3=`echo $1 | sed -e "s#$RE#\2#"`
#MINOR
eval $4=`echo $1 | sed -e "s#$RE#\3#"`
#SPECIAL
eval $5=`echo $1 | sed -e "s#$RE#\4#"`
}
if [ -z "$TRAVIS_TAG" ]; then
echo "TRAVIS_TAG is required to deploy"
exit 1
fi
MAJOR=0
MINOR=0
PATCH=0
SPECIAL=""
semverParseInto $TRAVIS_TAG MAJOR MINOR PATCH SPECIAL
npm run configure
npm run build
npm run package
if [ -z "$SPECIAL" ]; then
npm run publish:release
else
npm run publish
fi

View File

@ -2,12 +2,12 @@
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
wget https://redirector.gvt1.com/edgedl/go/go1.9.2.darwin-amd64.tar.gz
wget --quiet https://redirector.gvt1.com/edgedl/go/go1.9.2.darwin-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.9.2.darwin-amd64.tar.gz
elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then
wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
wget --quiet https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
fi

1030
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,22 @@
{
"name": "status-nodejs",
"version": "0.1.0",
"version": "0.2.0",
"description": "This package provides wrappers to status-go bindings.",
"main": "index.js",
"gypfile": true,
"dependencies": {},
"dependencies": {
"node-pre-gyp": "0.6.39"
},
"devDependencies": {
"chai": "4.1.2",
"mocha": "4.0.1",
"node-gyp": "3.6.2",
"node-pre-gyp": "0.6.39",
"node-pre-gyp-github": "1.3.1",
"tmp": "0.0.33"
},
"bundledDependencies": ["node-pre-gyp"],
"bundledDependencies": [
"node-pre-gyp"
],
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"configure": "node-pre-gyp configure",