machine:
  environment:
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace"
    VERSION: "2.0.0-dev"

dependencies:
  override:
    - mkdir -p ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME} ${HOME}/output
    - ln -s ${HOME}/${CIRCLE_PROJECT_REPONAME} ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - go get github.com/mitchellh/gox
    - go get github.com/tcnksm/ghr
    - ls -ahl ${HOME}/
    - gox -output="${HOME}/output/srcds_exporter_{{.OS}}_{{.Arch}}" -verbose ${HOME}/${CIRCLE_PROJECT_REPONAME}/...
    - >
      ghr -draft -replace -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -ldflags " \
        -X {{repoPath}}/version.Version=${VERSION} \
        -X {{repoPath}}/version.Revision=${CIRCLE_SHA1} \
        -X {{repoPath}}/version.Branch=${CIRCLE_BRANCH} \
        -X {{repoPath}}/version.BuildUser=$(whoami)@$(hostname) \
        -X {{repoPath}}/version.BuildDate=$(date)"
        ${CIRCLE_BRANCH}-build "${HOME}/output"

test:
  override:
    - govendor test -v -race ./...

machine:
  environment:
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace"
    VERSION: "2.0.0-dev"

dependencies:
  override:
    - mkdir -p ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME} ${HOME}/output
    - ln -s ${HOME}/${CIRCLE_PROJECT_REPONAME} ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - go get github.com/mitchellh/gox
    - go get github.com/tcnksm/ghr
    - gox -output="${HOME}/output/srcds_exporter_{{.OS}}_{{.Arch}}" -verbose github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - >
      ghr -draft -replace -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -ldflags " \
        -X {{repoPath}}/version.Version=${VERSION} \
        -X {{repoPath}}/version.Revision=${CIRCLE_SHA1} \
        -X {{repoPath}}/version.Branch=${CIRCLE_BRANCH} \
        -X {{repoPath}}/version.BuildUser=$(whoami)@$(hostname) \
        -X {{repoPath}}/version.BuildDate=$(date)"
        ${CIRCLE_BRANCH}-build "${HOME}/output"

test:
  override:
    - govendor test -v -race ./...

Package as path for gox??
Package as path for gox??
