Skip to content

Commit

Permalink
Merge pull request #43 from phoreproject/travis
Browse files Browse the repository at this point in the history
Add build and deploy script to travis
  • Loading branch information
meyer9 authored May 8, 2019
2 parents f343475 + 5cb14d9 commit dc2901f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.prof
*.test
dist

# binaries
synapsebeacon
Expand Down
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
go:
- 1.11.4

sudo: required
services:
- docker

# Only clone the most recent commit.
git:
depth: 1
Expand All @@ -17,6 +21,9 @@ git:
notifications:
email: false

before_install:
- go get github.com/tcnksm/ghr

# Anything in before_script that returns a nonzero exit code will flunk the
# build and immediately stop. It's sorta like having set -e enabled in bash.
# Make sure golangci-lint is vendored.
Expand All @@ -31,4 +38,7 @@ script:
- make integrationtests

after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
- ./deploy.sh

secure: "UnH2bHP7/LZy3S4iXuno+9xbo1oRsVAUIOLdj4g2EJIJvAVjHd4eHcHy3+mCoF9KXYIszyDn6KEKIeegAissqsOnKDFBsSPs0Lmuy2AEfWELVjC7BF5Ld3/lejhdFwOTDFHy3qTN0015MTIucjx/mz8gamHBRzJI8EKYT+hanOagBgVnRLFz35MqXDvups+iXM6hCoXbwSlBQBKSP281fudMnfIokOV02EA74pS5aADcYoCcZc2MUlwTcSbhNy/z9eJrpVNk3KsC7dsIeqXwoUnRYJ9/64HvikMhgqeT49LCTMaUhCh5HSmJT8Ab3rsKyM023Raxat2XiMdKRidCz0XW1K2Jzj6BuRzCqTy7SIxQ752Is57B2ililoDfmY0qxB0dIca1gJihf0r1np0ijW0PYmBIZ/ubLclTaJknK7CqMWLyd9ydedzA3QFgdBVgd4qapamJU99w49YeKP7LAzXgj2Ye0SeuPVdEFNKUPn3r5wtMgNQhpND7AbqWt3BhFa6SP3X5cfEM4BjuyKHofLl4b0JJefa+EFK73Dy94ac8QCrmRgBbfqPqvsIN9UOvg3bla1sMRF84YXeL98NXLOYdMPoYrUL8pEdG9xnhO2MC7+rGzSkck4gmhQv2LtL/XqXiYBSDeLf8/+I/dADUzGI6gmvfD4Vqga66JVfayLQ="
20 changes: 20 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if [ ! -z "$TRAVIS_TAG" ] &&
[ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "This will deploy!"

# Cross-compile for all platforms
export CGO_ENABLED=1
docker pull karalabe/xgo-latest
go get github.com/karalabe/xgo
mkdir dist/ && cd dist/
xgo --targets=windows/amd64,darwin/amd64,linux/amd64 ../cmd/beacon
xgo --targets=windows/amd64,darwin/amd64,linux/amd64 ../cmd/validator
xgo --targets=windows/amd64,darwin/amd64,linux/amd64 ../cmd/keygen
chmod +x *
# Upload to GitHub Release page
ghr --username phoreproject -t $GITHUB_TOKEN --replace --prerelease --debug $TRAVIS_TAG .
else
echo "This will not deploy!"
fi
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require (
github.com/go-test/deep v1.0.1
github.com/golang/protobuf v1.3.0
github.com/google/pprof v0.0.0-20190502144155-8358a9778bd1 // indirect
github.com/karalabe/xgo v0.0.0-20190301120235-2d6d1848fb02 // indirect
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.2.8 // indirect
github.com/libp2p/go-libp2p v0.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8 h1:bspPhN+oKYFk5f
github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/karalabe/xgo v0.0.0-20190301120235-2d6d1848fb02 h1:nI4Q7WQDcng8eRmi8bRP1SXlJIYLkgdgR7ZhJuzPbhs=
github.com/karalabe/xgo v0.0.0-20190301120235-2d6d1848fb02/go.mod h1:iYGcTYIPUvEWhFo6aKUuLchs+AV4ssYdyuBbQJZGcBk=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
Expand Down

0 comments on commit dc2901f

Please sign in to comment.