diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 883392715..c761b8035 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -3,6 +3,8 @@ builds: - main: ./cmd/operator binary: elemental-operator id: elemental-operator + env: + - CGO_ENABLED=0 ldflags: - -w -s - -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}} @@ -20,6 +22,27 @@ builds: - main: ./cmd/register binary: elemental-register id: elemental-register + env: + - CGO_ENABLED=1 + ldflags: + - -w -s + - -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}} + - -X github.com/rancher/elemental-operator/pkg/version.Commit={{.Commit}} + - -X github.com/rancher/elemental-operator/pkg/version.CommitDate={{.CommitDate}} + goos: + - linux + goarch: + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 + - main: ./cmd/support + binary: elemental-support + id: elemental-support + env: + - CGO_ENABLED=0 ldflags: - -w -s - -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}} diff --git a/Makefile b/Makefile index e0526f40c..2c510823c 100644 --- a/Makefile +++ b/Makefile @@ -22,16 +22,16 @@ build: operator register support .PHONY: operator operator: - go build -ldflags '$(LDFLAGS)' -o build/elemental-operator $(ROOT_DIR)/cmd/operator + CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o build/elemental-operator $(ROOT_DIR)/cmd/operator .PHONY: register register: - go build -ldflags '$(LDFLAGS)' -o build/elemental-register $(ROOT_DIR)/cmd/register + CGO_ENABLED=1 go build -ldflags '$(LDFLAGS)' -o build/elemental-register $(ROOT_DIR)/cmd/register .PHONY: support support: - go build -ldflags '$(LDFLAGS)' -o build/elemental-support $(ROOT_DIR)/cmd/support + CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o build/elemental-support $(ROOT_DIR)/cmd/support .PHONY: build-docker-operator @@ -113,4 +113,4 @@ kind-e2e-tests: build-docker-operator chart setup-kind # thus losing any registration/inventories/os CRDs already created reload-operator: build-docker-operator chart kind load docker-image --name $(CLUSTER_NAME) ${REPO}:${TAG} - helm upgrade -n cattle-elemental-system elemental-operator $(CHART) \ No newline at end of file + helm upgrade -n cattle-elemental-system elemental-operator $(CHART)