From 3bbf170843f2e675be209d6bdd9ae2c0ab382ac2 Mon Sep 17 00:00:00 2001 From: Christoph Petrausch Date: Sun, 30 Dec 2018 23:42:39 +0100 Subject: [PATCH] Added binary deployment --- .travis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8af6576..5edcdd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,22 @@ script: | GOOS=linux GOARCH=arm GOARM=${version} make build done +after_success: + - | + if [[ "${TRAVIS_PULL_REQUEST?}" == "false" ]] && [[ -n "${TRAVIS_TAG?}" ]]; then + go get github.com/itchio/gothub # install release cli + projectMeta="--user hikhvar --repo mqtt2prometheus --tag ${TRAVIS_TAG}" + gothub release \ + ${projectMeta} \ + --name "Version ${TRAVIS_TAG}" \ + --description "Automatic binary release of the git tag ${TRAVIS_TAG}" \ + --pre-release + + for srcFile in $(find bin/ -type f); do + gothub upload \ + ${projectMeta} \ + --name ${srcFile#bin/} \ + --file ${srcFile} + done + + fi