# https://taskfile.dev

version: '3'

tasks:
  build:
    cmds:
      - go build -ldflags "-X github.com/noqqe/serra/src/serra.Version=`git describe --tags`"  -v serra.go
    sources:
      - "src/serra/**/*.go"
      - "serra.go"
    generates:
      - "./serra"

  release:
    interactive: true
    cmds:
      - git tag | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -5
      - read -p "Version v1.1.1 " version ; git tag $version
      - git push --tags
      - goreleaser release --clean
      - docker build . -t ghcr.io/noqqe/serra:`git describe --tags`
      - docker push ghcr.io/noqqe/serra:`git describe --tags`

  default:
    cmds:
      - task: build

