From 4f099ebe5f1782816f3925fb7b70488974592987 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 8 Oct 2018 15:16:12 +0200 Subject: [PATCH] Update build system / GH publish Signed-off-by: Knut Ahlers --- .repo-runner.yaml | 2 +- Makefile | 7 +++++-- publish.sh | 31 ------------------------------- 3 files changed, 6 insertions(+), 34 deletions(-) delete mode 100755 publish.sh diff --git a/.repo-runner.yaml b/.repo-runner.yaml index d54498e..4db069b 100644 --- a/.repo-runner.yaml +++ b/.repo-runner.yaml @@ -1,6 +1,6 @@ --- -image: "quay.io/luzifer/repo-runner-image" +image: "reporunner/golang-alpine" checkout_dir: /go/src/github.com/Luzifer/duplicity-backup commands: diff --git a/Makefile b/Makefile index 4f18770..5523bf9 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ bindata: go-bindata help.txt -ci: - ./publish.sh +ci: publish + +publish: + curl -sSLo golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh + bash golang.sh setup-testenv: go get github.com/onsi/ginkgo/ginkgo diff --git a/publish.sh b/publish.sh deleted file mode 100755 index 3e57c0b..0000000 --- a/publish.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -VERSION=$(git describe --tags --exact-match) -REPO=$(basename $(pwd)) -ARCHS="linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/amd64" - -set -e - -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 - -gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" -sha256sum ${REPO}_* > SHA256SUMS - -github-release release --user Luzifer --repo ${REPO} --tag ${VERSION} --name ${VERSION} --draft || true - -for file in ${REPO}_* SHA256SUMS; do - github-release upload --user Luzifer --repo ${REPO} --tag ${VERSION} --name ${file} --file ${file} -done