image: "golang:1-alpine" stages: - build - publish before_script: # Disabling cgo to not install gcc - export CGO_ENABLED=0 - export GOARCH=amd64 build_linux_amd64: stage: build script: - export GOOS=linux - go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" . - ./magnetico-go-migrator-$GOOS --help artifacts: paths: - magnetico-go-migrator-* build_windows_amd64: stage: build script: - export GOOS=windows - go build -o ./magnetico-go-migrator-$GOOS.exe "-ldflags=-s -w" . artifacts: paths: - magnetico-go-migrator-*.exe build_darwin_amd64: stage: build script: - export GOOS=darwin - go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" . artifacts: paths: - magnetico-go-migrator-* #publish: # image: inetprocess/gitlab-release # stage: publish # only: # - tags # script: # - gitlab-release --message 'New release' magnetico-go-migrator-linux-$CI_BUILD_TAG magnetico-go-migrator-windows-$CI_BUILD_TAG.exe magnetico-go-migrator-darwin-$CI_BUILD_TAG