diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b9a0d5a..225615b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,31 +1,46 @@ 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-$GOARCH . - - ./magnetico-go-migrator-$GOOS-$GOARCH --help + - go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" . + - ./magnetico-go-migrator-$GOOS --help artifacts: paths: - - magnetico-go-migrator-*-* + - magnetico-go-migrator-* build_windows_amd64: + stage: build script: - export GOOS=windows - - go build -o ./magnetico-go-migrator-$GOOS-$GOARCH . + - go build -o ./magnetico-go-migrator-$GOOS.exe "-ldflags=-s -w" . artifacts: paths: - - magnetico-go-migrator-*-* + - magnetico-go-migrator-*.exe build_darwin_amd64: + stage: build script: - export GOOS=darwin - - go build -o ./magnetico-go-migrator-$GOOS-$GOARCH . + - go build -o ./magnetico-go-migrator-$GOOS "-ldflags=-s -w" . artifacts: paths: - - magnetico-go-migrator-*-* + - 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 \ No newline at end of file