diff --git a/.travis.yml b/.travis.yml index 629472e..98049f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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]"* \ No newline at end of file