.parallel:
  parallel:
    matrix:
    - GOOS: "linux"
      GOARCH:
      - amd64
      - arm64
    - GOOS: "windows"
      GOARCH:
      - amd64
      - arm64
    - GOOS: "darwin"
      GOARCH:
      - amd64
      - arm64

stages:
- build
- deploy

build-application-binary:
  stage: build
  needs: []
  parallel: !reference [ .parallel, parallel ]
  image: golang:1.24.0
  script:
  - CGO_ENABLED=0 go build -ldflags="-s -w" -o ems-esp-logger-${GOOS}-${GOARCH} ./
  - "if [ \"${GOOS}\" = \"windows\" ]; then

    \  mv ems-esp-logger-${GOOS}-${GOARCH} ems-esp-logger-${GOOS}-${GOARCH}.exe\ 

    fi\n"
  artifacts:
    paths:
    - ems-esp-logger-${GOOS}-${GOARCH}
    - ems-esp-logger-${GOOS}-${GOARCH}.exe
    expire_in: 1 week

include:
- project: 'infra/ci'
  file: '/pipelines/docker.yml'
