diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index ce45f770f04..b71391103c6 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -201,6 +201,12 @@ for (const item of targets) { }, }) + // Embedding the bundle invalidates the linker's ad-hoc signature, and macOS 27+ + // SIGKILLs binaries with invalid pages. Re-sign ad-hoc; release CI re-signs with Developer ID. + if (item.os === "darwin" && process.platform === "darwin") { + await $`codesign --force --sign - dist/${name}/bin/opencode` + } + // Smoke test: only run if binary is for current platform if (item.os === process.platform && item.arch === process.arch && !item.abi) { const binaryPath = `dist/${name}/bin/opencode`