From f608aed620b0b5ec9bc63b4cc0c43eee826f6d81 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Mon, 3 Feb 2025 18:19:27 -0800 Subject: [PATCH] Explicitly disable CGO in .goreleaser.yml In other repos, we've run into problems when the runner used to publish builds switched from macOS to Ubuntu because CGO is disabled by default on macOS but enabled on Ubuntu, and when CGO is enabled, by default the built binary will be dynamically linked. We want statically linked files on Linux so the binary works across different OSes. This commit preemptively explicitly disables CGO in `.goreleaser.yml` and `.goreleaser.prerelease.yml` to ensure the binaries remain statically linked if/when the GHA runner is changed to Ubuntu. --- .goreleaser.prerelease.yml | 2 ++ .goreleaser.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.goreleaser.prerelease.yml b/.goreleaser.prerelease.yml index 131be28..0eaec65 100644 --- a/.goreleaser.prerelease.yml +++ b/.goreleaser.prerelease.yml @@ -15,6 +15,8 @@ archives: builds: - id: pulumi-lsp binary: pulumi-lsp + env: + - CGO_ENABLED=0 goarch: - amd64 - arm64 diff --git a/.goreleaser.yml b/.goreleaser.yml index e47a678..ff5b235 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,6 +13,8 @@ archives: builds: - id: pulumi-lsp binary: pulumi-lsp + env: + - CGO_ENABLED=0 goarch: - amd64 - arm64