From 02547a694e4a0faafe5ac20e91777155141ef25f Mon Sep 17 00:00:00 2001 From: Greg Szabo Date: Sun, 14 Apr 2019 02:34:09 -0400 Subject: [PATCH] Release fixes - static build and version in binary --- .circleci/release.bash | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/release.bash b/.circleci/release.bash index fd07f93..66b2337 100644 --- a/.circleci/release.bash +++ b/.circleci/release.bash @@ -44,7 +44,7 @@ if [[ ! -f "build/${binary}" ]]; then echo "${binary} does not exist." continue fi -curl -s -S -X POST -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" "https://uploads.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/${id}/assets?name=${binary}" --user-agent releasebot -H "Accept: application/vnd.github.v3.raw+json" -H "Content-Type: application/octet-stream" -H "Content-Encoding: utf8" --data-binary "@build/${binary}" > upload.json +curl -s -S -X POST -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" "https://uploads.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/${id}/assets?name=${binary}_${CIRCLE_TAG}_linux_amd64" --user-agent releasebot -H "Accept: application/vnd.github.v3.raw+json" -H "Content-Type: application/octet-stream" -H "Content-Encoding: utf8" --data-binary "@build/${binary}" > upload.json ERR=$? if [[ $ERR -ne 0 ]]; then echo "ERROR: curl error, exitcode $ERR." diff --git a/Makefile b/Makefile index 2f4b987..7958088 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ GOPATH ?= $(shell go env GOPATH) .PHONY: build test lint package build: - GO111MODULE=on go build -o $(OUTPUTDIR)/delegation cmd/delegation/main.go - GO111MODULE=on go build -o $(OUTPUTDIR)/stake-dist cmd/stake-dist/main.go + GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-extldflags static" -o $(OUTPUTDIR)/delegation cmd/delegation/main.go + GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-extldflags static" -o $(OUTPUTDIR)/stake-dist cmd/stake-dist/main.go test: GO111MODULE=on go test -cover -race ./...