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 - checkout
- run: make build-linux - run: make build-linux
- persist_to_workspace: - persist_to_workspace:
root: . root: release
paths: paths:
- bin/linux - bin/linux
build-darwin: build-darwin:
@ -32,21 +32,22 @@ jobs:
- checkout - checkout
- run: make build-darwin - run: make build-darwin
- persist_to_workspace: - persist_to_workspace:
root: . root: release
paths: paths:
- bin/darwin - bin/darwin
release: release:
docker: docker:
- image: circleci/golang:latest - image: circleci/golang:latest
steps: steps:
- run: mkdir -p bin - run: mkdir -p release/bin/darwin
- run: mkdir -p release/bin/linux
- attach_workspace: - attach_workspace:
at: bin at: release
- run: - run:
name: "Publish Release on GitHub" name: "Publish Release on GitHub"
command: | command: |
go get github.com/tcnksm/ghr 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: workflows:
version: 2 version: 2
build: build:

View File

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