machine:
  environment:
    GODIST: "go1.7.linux-amd64.tar.gz"
    IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
  post:
    - mkdir -p download
    - test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
    - sudo rm -rf /usr/local/go
    - sudo tar -C /usr/local -xzf download/$GODIST
  services:
    - docker
deployment:
 release:
 branch: master
 commands:
 — go get github.com/mitchellh/gox
 — go get github.com/tcnksm/ghr
 — gox -ldflags "-X main.Version $BUILD_VERSION -X main.BuildDate $BUILD_DATE" -output "dist/ncd_{{.OS}}_{{.Arch}}"
 — ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/

Configure continuous deployment with CircleCi
Configure continuous deployment with CircleCi
