Skip to content

Commit

Permalink
add travis
Browse files Browse the repository at this point in the history
  • Loading branch information
cxjava committed Nov 14, 2019
1 parent 7e9b3de commit d47f12e
Showing 1 changed file with 45 additions and 7 deletions.
52 changes: 45 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
language: go
sudo: false

go:
- 1.7
- 1.13.x

env:
global:
- GO111MODULE=on
- GORELEASER_VERSION=0.120.2
- UPXVER="3.94"

install:
- go get -t -v
script:
- go test -v
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
- curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh -s -- -b $(go env GOPATH)/bin v${GORELEASER_VERSION}
- |
if [[ ! -f "$(go env GOPATH)/bin/upx" ]]
then
echo "Installing upx .."
curl -OL "https://github.com/upx/upx/releases/download/v${UPXVER}/upx-${UPXVER}-amd64_linux.tar.xz"
tar xvf "upx-${UPXVER}-amd64_linux.tar.xz"
cp "upx-${UPXVER}-amd64_linux/upx" "$(go env GOPATH)/bin"
fi
- ls -al
- upx --version
- chmod +x upx.sh
- ls -al
- go get -u -v github.com/UnnoTed/fileb0x
- go install github.com/UnnoTed/fileb0x

deploy:
- provider: script
skip_cleanup: true
script: >-
export GO_VERSION="$(go version)" &&
export BUILT_BY="$(whoami)@$(hostname)" &&
goreleaser release --skip-validate --skip-sign --debug
on:
all_branches: true
condition: $TRAVIS_COMMIT_MESSAGE == *"[release]"*

- provider: script
skip_cleanup: true
script: >-
export GO_VERSION="$(go version)" &&
export BUILT_BY="$(whoami)@$(hostname)" &&
goreleaser release --snapshot --skip-publish --rm-dist --debug
on:
all_branches: true
condition: $TRAVIS_COMMIT_MESSAGE == *"[test]"*

0 comments on commit d47f12e

Please sign in to comment.