releasing

This commit is contained in:
Liam Galvin 2018-11-24 20:01:11 +00:00
parent dbe5688fa0
commit 1f4292683e
2 changed files with 8 additions and 7 deletions

View File

@ -21,7 +21,7 @@ jobs:
- checkout
- run: make build-linux
- persist_to_workspace:
root: .
root: release
paths:
- bin/linux
build-darwin:
@ -32,21 +32,22 @@ jobs:
- checkout
- run: make build-darwin
- persist_to_workspace:
root: .
root: release
paths:
- bin/darwin
release:
docker:
- image: circleci/golang:latest
steps:
- run: mkdir -p bin
- run: mkdir -p release/bin/darwin
- run: mkdir -p release/bin/linux
- attach_workspace:
at: bin
at: release
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} bin/
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} release/bin/
workflows:
version: 2
build:

View File

@ -30,10 +30,10 @@ update-fonts: install-tools
.PHONY: build-linux
build-linux:
mkdir -p bin/linux
mkdir -p release/bin/linux
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o bin/${BINARY}-linux-amd64 -ldflags "-X main.Version=`${CIRCLE_TAG}`"
.PHONY: build-darwin
build-darwin:
mkdir -p bin/darwin
mkdir -p release/bin/darwin
xgo -ldflags "-X main.Version=`${CIRCLE_TAG}`" --targets=darwin/amd64 --dest=bin/darwin -out ${BINARY}-darwin-amd64 .