From eee785dda6b10d0126c71b294a4152c169f19232 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 29 Nov 2016 13:49:39 +0100 Subject: [PATCH] Update publishing mechanic --- .travis.yml | 2 +- Makefile | 3 +++ publish.sh | 34 ---------------------------------- 3 files changed, 4 insertions(+), 35 deletions(-) create mode 100644 Makefile delete mode 100755 publish.sh diff --git a/.travis.yml b/.travis.yml index 2b62933..b79e751 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,4 @@ go: - 1.7 script: - - ./publish.sh + - make ci diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a44ded0 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +ci: + curl -sSLo golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh + bash golang.sh diff --git a/publish.sh b/publish.sh deleted file mode 100755 index 027bcd2..0000000 --- a/publish.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -VERSION=$(git describe --tags --exact-match) -REPO=$(basename $(pwd)) -ARCHS="linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386" - -set -e - -if [ -z "${TRAVIS_TAG}" ]; then - echo "Not executing for non tag, but this is no failure." - exit 0 -fi - -if [ -z "${VERSION}" ]; then - echo "No tag present, stopping build now." - exit 0 -fi - -if [ -z "${GITHUB_TOKEN}" ]; then - echo "Please set \$GITHUB_TOKEN environment variable" - exit 1 -fi - -set -x - -go get github.com/aktau/github-release -go get github.com/mitchellh/gox - -github-release release --user Jimdo --repo ${REPO} --tag ${VERSION} --name ${VERSION} || true - -gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" -for file in ${REPO}_*; do - github-release upload --user Jimdo --repo ${REPO} --tag ${VERSION} --name ${file} --file ${file} -done