diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9f122e..fae72ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ build:x86: - cp -r * /go/src/gitlab.com/signald/signald-go - cd /go/src/gitlab.com/signald/signald-go script: - - go build -o "${CI_PROJECT_DIR}/signaldctl" ./cmd/signaldctl + - go build -o "${CI_PROJECT_DIR}/signaldctl" --ldflags "-X gitlab.com/signald/signald-go/cmd/signaldctl/common.Version=$(git -C ${CI_PROJECT_DIR} describe) -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Branch=${CI_COMMIT_BRANCH} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Commit=${CI_COMMIT_SHA}" ./cmd/signaldctl artifacts: paths: - signaldctl @@ -38,8 +38,7 @@ build:cross-compile: - cp -r * /go/src/gitlab.com/signald/signald-go - cd /go/src/gitlab.com/signald/signald-go script: - - make signaldctl - - mv signaldctl "${CI_PROJECT_DIR}/signaldctl-${GOOS}-${GOARCH}" + - go build -o "${CI_PROJECT_DIR}/signaldctl-${GOOS}-${GOARCH}" --ldflags "-X gitlab.com/signald/signald-go/cmd/signaldctl/common.Version=$(git -C ${CI_PROJECT_DIR} describe) -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Branch=${CI_COMMIT_BRANCH} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Commit=${CI_COMMIT_SHA}" ./cmd/signaldctl artifacts: paths: - signaldctl-* @@ -63,7 +62,7 @@ build:aarch64: - cp -r * /go/src/gitlab.com/signald/signald-go - cd /go/src/gitlab.com/signald/signald-go script: - - go build -o "${CI_PROJECT_DIR}/signaldctl" ./cmd/signaldctl + - go build -o "${CI_PROJECT_DIR}/signaldctl" --ldflags "-X gitlab.com/signald/signald-go/cmd/signaldctl/common.Version=$(git -C ${CI_PROJECT_DIR} describe) -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Branch=${CI_COMMIT_BRANCH} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Commit=${CI_COMMIT_SHA}" ./cmd/signaldctl artifacts: paths: - signaldctl