From 671fcd8e872dbd7667de8c1123a7672225cbd832 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 28 Mar 2016 00:28:46 -0300 Subject: [PATCH] removing old release script in favor of go-release --- circle.yml | 2 +- scripts/release.sh | 77 ---------------------------------------------- 2 files changed, 1 insertion(+), 78 deletions(-) delete mode 100755 scripts/release.sh diff --git a/circle.yml b/circle.yml index 31a856a..fd01e98 100644 --- a/circle.yml +++ b/circle.yml @@ -5,7 +5,7 @@ deployment: release: tag: /v[0-9]+(\.[0-9]+)*/ commands: - - ./scripts/release.sh + - curl -s https://raw.githubusercontent.com/caarlos0/go-releaser/master/release | bash -s -- -u getantibody -r antibody -b antibody -m ./cmd/antibody/ -e antibody.zsh test: pre: - go get github.com/pierrre/gotestcover diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index 8564d1c..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -set -e - -# enables go 1.5 vendor expirement -export GO15VENDOREXPERIMENT=1 - -cleanup() { - rm -rf dist -} - -# normalize Golang's OS and Arch to uname compatibles -normalize() { - echo "$1" | sed \ - -e 's/darwin/Darwin/' \ - -e 's/linux/Linux/' \ - -e 's/freebsd/FreeBSD/' \ - -e 's/openbsd/OpenBSD/' \ - -e 's/netbsd/NetBSD/' \ - -e 's/386/i386/' \ - -e 's/amd64/x86_64/' -} - -# builds the binaries with gox -build() { - echo "Building $CURRENT..." - go get github.com/mitchellh/gox - gox -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}/antibody" \ - -os="linux darwin freebsd openbsd netbsd" \ - -ldflags="-X main.version $CURRENT" \ - ./cmd/antibody/ -} - -# package the binaries in .tar.gz files -package() { - echo "Packaging $CURRENT..." - for folder in ./dist/*; do - local filename="$(normalize "$folder").tar.gz" - tar -cvzf "$filename" "${folder}/antibody" antibody.zsh README.md LICENSE - done -} - -# release it to github -release() { - echo "Releasing $CURRENT..." - local -r log="$(git log --pretty=oneline --abbrev-commit "$PREVIOUS".."$CURRENT")" - local -r description="${log}\n\nBuilt with: $(go version)" - go get github.com/aktau/github-release - echo "Creating release $CURRENT..." - github-release release \ - --user getantibody \ - --repo antibody \ - --tag "$CURRENT" \ - --description "$description" \ - --pre-release || - github-release edit \ - --user getantibody \ - --repo antibody \ - --tag "$CURRENT" \ - --description "$description" \ - --pre-release - for file in ./dist/*.tar.gz; do - echo "--> Uploading $file..." - github-release upload \ - --user getantibody \ - --repo antibody \ - --tag "$CURRENT" \ - --name "$(echo $file | sed 's/\.\/dist\///')" \ - --file "$file" - done -} - -cleanup -CURRENT="$(git describe --tags --abbrev=0)" -PREVIOUS=$(git describe --tags --abbrev=0 ${CURRENT}^) -build -package -release