From b8ccebcbcaaa68cdd478031e9c9cae13cde34e37 Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky Date: Fri, 26 Jan 2024 08:01:12 -0600 Subject: [PATCH] Release fleetctl for macOS as a universal binary (native support for both amd64 and arm64 architectures). (#16346) Release fleetctl for macOS as a universal binary (native support for both amd64 and arm64 architectures). #9047 Tested goreleaser locally. --- .goreleaser.yml | 27 +++++++++++++++++++++++++- changes/9047-fleetctl-universal-binary | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 changes/9047-fleetctl-universal-binary diff --git a/.goreleaser.yml b/.goreleaser.yml index e36fcc39c..e4fa880ed 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -40,7 +40,6 @@ builds: env: - CGO_ENABLED=0 goos: - - darwin - linux - windows goarch: @@ -55,6 +54,32 @@ builds: - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }} - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }} + - id: fleetctl-macos + dir: ./cmd/fleetctl/ + binary: fleetctl + env: + - CGO_ENABLED=0 + goos: + - darwin + goarch: + - amd64 + - arm64 + flags: + - -trimpath + ldflags: + - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }} + - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }} + - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }} + - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }} + - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }} + - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }} + +universal_binaries: + - id: fleetctl # resulting binary id + ids: [fleetctl-macos] # source binaries + replace: true + name_template: fleetctl # resulting binary name + archives: - id: fleet builds: diff --git a/changes/9047-fleetctl-universal-binary b/changes/9047-fleetctl-universal-binary new file mode 100644 index 000000000..3ae66e522 --- /dev/null +++ b/changes/9047-fleetctl-universal-binary @@ -0,0 +1 @@ +Release fleetctl for macOS as a universal binary (native support for both amd64 and arm64 architectures).