distributable:
  url: https://github.com/kubecolor/kubecolor/archive/v{{version}}.tar.gz
  strip-components: 1

versions:
  github: kubecolor/kubecolor

build:
  dependencies:
    go.dev: ^1.21
  script:
    go build $ARGS -ldflags="$LDFLAGS" .
  env:
    CGO_ENABLED: 0
    LDFLAGS:
      - -s
      - -w
      - -X main.Version={{version}}
    ARGS:
      - -trimpath
      - -o={{prefix}}/bin/kubecolor
    linux:
      ARGS:
        - -buildmode=pie

provides:
  - bin/kubecolor

test:
  - kubecolor --kubecolor-version | grep {{version}}
