version: "3"

vars:
  VERSION:
    sh: head -n 1 ./CHANGELOG.md | cut -c 2-


tasks:
  update-linter:
    cmds:
      - go get -u penahub.gitlab.yandexcloud.net/devops/linters/golang.git
  lint:
    cmds:
      - task: update-linter
      - cmd: golangci-lint run -v -c $(go list -f '{{"{{"}}.Dir{{"}}"}}' -m gitea.pena/PenaSide/linters-golang)/.golangci.yml
  version:
    cmds:
      - echo "{{.VERSION}}"
  tag-create:
    cmds: 
      - git tag {{.VERSION}}
  tag-remove:
    cmds:
      - git tag -d {{.VERSION}}
