From 36eaa3a3832332597be3fcf55fe3b64c45d4c6a4 Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Thu, 12 Mar 2026 15:36:20 +0000 Subject: [PATCH] fix: restore BuiltBy=goreleaser ldflag in GoReleaser configs The BuiltBy ldflag was removed in 73a97c77 when switching to runtime/debug for version info. Unlike Version, Commit, and Date, BuiltBy has no source in runtime/debug and needs an explicit ldflag. Without it, GoReleaser-built binaries incorrectly report "built ... by local". Closes [CLI-115: Restore BuiltBy=goreleaser ldflag in GoReleaser config](https://linear.app/platformsh/issue/CLI-115/restore-builtbygoreleaser-ldflag-in-goreleaser-config) Co-Authored-By: Claude Opus 4.6 (1M context) --- .goreleaser.vendor.yaml.tpl | 2 ++ .goreleaser.yaml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.goreleaser.vendor.yaml.tpl b/.goreleaser.vendor.yaml.tpl index 564257b6c..aa2c32d4c 100644 --- a/.goreleaser.vendor.yaml.tpl +++ b/.goreleaser.vendor.yaml.tpl @@ -25,6 +25,7 @@ builds: goarch: arm64 ldflags: - -s -w + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform - binary: ${VENDOR_BINARY} @@ -40,6 +41,7 @@ builds: - arm64 ldflags: - -s -w + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9898b379f..55d3bab63 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -26,6 +26,7 @@ builds: ldflags: - -s -w - -X "github.com/upsun/cli/internal/config.Version={{.Version}}" + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform - binary: platform @@ -42,6 +43,7 @@ builds: ldflags: - -s -w - -X "github.com/upsun/cli/internal/config.Version={{.Version}}" + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform @@ -61,6 +63,7 @@ builds: ldflags: - -s -w - -X "github.com/upsun/cli/internal/config.Version={{.Version}}" + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform - binary: upsun @@ -75,6 +78,7 @@ builds: ldflags: - -s -w - -X "github.com/upsun/cli/internal/config.Version={{.Version}}" + - -X "github.com/upsun/cli/internal/config.BuiltBy=goreleaser" - -X "github.com/upsun/cli/internal/legacy.PHPVersion={{.Env.PHP_VERSION}}" main: ./cmd/platform