when:
  event: [push, tag]

steps:
  build_test:
    image: golang:1.25
    commands:
      - go build

  build_release:
    image: golang:1.25
    commands:
      - go mod vendor
      - GOOS=linux GOARCH=amd64 go build -o "dist/goblin-store-linux-amd64-${CI_COMMIT_TAG}"
      - GOOS=windows GOARCH=amd64 go build -o "dist/goblin-store-windows-amd64-${CI_COMMIT_TAG}.exe"
    when:
      event: tag

  gitea_release:
    image: plugins/gitea-release
    settings:
      api_key:
        from_secret: gitea_api_key
      base_url: https://git.metaunix.net
      title: "${CI_COMMIT_TAG}"
      files:
        - dist/goblin-store-*
    when:
      event: tag
