image: golang:latest

variables:
  BIN_NAME: comfy-translator
  ARTIFACTS_DIR: artifacts
  GO_PROJECT:  gitgud.io/softashell/comfy-translator
  OUTPUT_PATH: ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${BIN_NAME}
  CGO_ENABLED: 1

before_script:
  - mkdir -p ${GOPATH}/src/${GO_PROJECT}
  - mkdir -p ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}

test:
  dependencies: []
  script:
    - go test ./...

build:win64:
  stage: build
  variables:
    GOOS: windows
    GOARCH: amd64
  script:
    - go build -o ${OUTPUT_PATH}.exe
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

build:linux64:
  stage: build
  variables:
    GOOS: linux
    GOARCH: amd64
  script:
    - go build -o ${OUTPUT_PATH}
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

build:osx:
  stage: build
  variables:
    GOOS: darwin
    GOARCH: amd64
  script:
    - go build -o ${OUTPUT_PATH}
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

image: golang:latest

variables:
  BIN_NAME: comfy-translator
  ARTIFACTS_DIR: artifacts
  GO_PROJECT:  gitgud.io/softashell/comfy-translator
  OUTPUT_PATH: ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${BIN_NAME}

before_script:
  - mkdir -p ${GOPATH}/src/${GO_PROJECT}
  - mkdir -p ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}

test:
  dependencies: []
  script:
    - go test ./...

build:win64:
  stage: build
  variables:
    GOOS: windows
    GOARCH: amd64
  script:
    - go build -o ${OUTPUT_PATH}.exe
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

build:linux64:
  stage: build
  variables:
    GOOS: linux
    GOARCH: amd64
    CGO_ENABLED: 1
  script:
    - go build -o ${OUTPUT_PATH}
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

build:osx:
  stage: build
  variables:
    GOOS: darwin
    GOARCH: amd64
  script:
    - go build -o ${OUTPUT_PATH}
  artifacts:
    name: "$CI_BUILD_NAME"
    paths:
      - ${ARTIFACTS_DIR}

Enable CGO for linux, win64 and osx remain stubbed
Enable CGO for linux, win64 and osx remain stubbed
