distributable:    
  url: https://github.com/go-task/task/archive/refs/tags/v{{version}}.tar.gz
  strip-components: 1

displayname: Task

versions:
  github: go-task/task/releases/tags

provides:
  - bin/task

build:
  dependencies:
    go.dev: ^1.19
  script: go build -o {{prefix}}/bin/task -ldflags="$LDFLAGS"  ./cmd/task
  env:
    GOBIN: ${{prefix}}/bin
    LDFLAGS:
      - -s
      - -w
      - -X github.com/go-task/task/v3/internal/version.version={{version}}
    linux:
      # or segmentation fault
      # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
      LDFLAGS:
        - -buildmode=pie

test:
  script: |
    task --init
    test -f Taskfile.yml
    task --version | grep 'Task version: {{version}}'
