- task: get_version
  code: grep "const version" cmd/dog/main.go | cut -d'"' -f2
  register: DOG_VERSION

- task: clean
  description: Clean compiled binaries
  code: rm -rf dist dog-*

- task: build
  description: Build dog binary for current platform
  env: OUTPUT_PATH=dist/current
  code: |
    go build \
      -ldflags "-s -w" \
      -o "${OUTPUT_PATH}/dog" \
      cmd/dog/*.go

- task: install-build-deps
  description: Install required dependencies for building dog
  code: go get -u github.com/mitchellh/gox

- task: build-all
  description: Build dog binary for all platforms
  pre: 
    - install-build-deps
    - clean
  env:
    - XC_ARCH=386 amd64 arm
    - XC_OS=linux darwin freebsd openbsd netbsd solaris
  code: |
    gox \
      -os="${XC_OS}" \
      -arch="${XC_ARCH}" \
      -ldflags "-s -w" \
      -output "dist/{{.OS}}_{{.Arch}}/dog" \
      ./cmd/dog/

- task: release
  description: Put all dist binaries in a compressed file
  pre:
    - build-all
    - get_version
  code: |
    mv -v dist dog-${DOG_VERSION}
    tar zcvf dog-${DOG_VERSION}.tar.gz dog-${DOG_VERSION}

- task: run-test-dogfiles
  description: Run all Tasks in testdata Dogfiles
  code: ./scripts/test-dogfiles.sh

- task: get-version
  code: grep "const version" cmd/dog/main.go | cut -d'"' -f2
  register: DOG_VERSION

- task: clean
  description: Clean compiled binaries
  code: rm -rf dist dog-*

- task: build
  description: Build dog binary for current platform
  env: OUTPUT_PATH=dist/current
  code: |
    go build \
      -ldflags "-s -w" \
      -o "${OUTPUT_PATH}/dog" \
      cmd/dog/*.go

- task: install-build-deps
  description: Install required dependencies for building dog
  code: go get -u github.com/mitchellh/gox

- task: build-all
  description: Build dog binary for all platforms
  pre: 
    - install-build-deps
    - clean
  env:
    - XC_ARCH=386 amd64 arm
    - XC_OS=linux darwin freebsd openbsd netbsd solaris
  code: |
    gox \
      -os="${XC_OS}" \
      -arch="${XC_ARCH}" \
      -ldflags "-s -w" \
      -output "dist/{{.OS}}_{{.Arch}}/dog" \
      ./cmd/dog/

- task: release
  description: Put all dist binaries in a compressed file
  pre:
    - build-all
    - get-version
  code: |
    mv -v dist dog-${DOG_VERSION}
    tar zcvf dog-${DOG_VERSION}.tar.gz dog-${DOG_VERSION}

- task: run-test-dogfiles
  description: Run all Tasks in testdata Dogfiles
  code: ./scripts/test-dogfiles.sh

Fix task name, low dash not supported
Fix task name, low dash not supported
