Skip to content

Commit

Permalink
add circleci integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhadfield committed Feb 6, 2019
1 parent 4337659 commit 000303e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.11
steps:
- checkout
- run: go test -v -failfast ./...
release:
docker:
- image: circleci/golang:1.11
steps:
- checkout
- run: go get github.com/tcnksm/ghr
- run: go get github.com/mitchellh/gox
- run: mkdir dist
- run: echo "export BUILD_TAG=$(git describe --tags)" >> $BASH_ENV
- run: echo "export BUILD_SHA=$(git rev-parse --short HEAD)" >> $BASH_ENV
- run: echo "export BUILD_DATE=$(date -u '+%Y/%m/%d:%H:%M:%S')" >> $BASH_ENV
- run: gox -verbose -osarch="darwin/amd64 linux/amd64 linux/arm linux/arm64 windows/amd64 netbsd/amd64 openbsd/amd64 freebsd/amd64" -ldflags "-X main.tag=$BUILD_TAG -X main.sha=$BUILD_SHA -X main.buildDate=$BUILD_DATE" -output "dist/aws-ips_{{.OS}}_{{.Arch}}" ./...
- run:
name: "Publish Release on GitHub"
command: |
VERSION=$(git describe --tags)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ./dist/
workflows:
version: 2
build-release:
jobs:
- build:
filters:
tags:
only: /.*/
- release:
requires:
- build
filters:
tags:
only: /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)/
branches:
ignore: /.*/

0 comments on commit 000303e

Please sign in to comment.