Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions packages/opencode/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const allTargets: {
arch: "arm64" | "x64"
abi?: "musl"
avx2?: false
noCa?: true
}[] = [
{
os: "linux",
Expand Down Expand Up @@ -117,6 +118,17 @@ const allTargets: {
arch: "x64",
avx2: false,
},
{
os: "win32",
arch: "x64",
noCa: true,
},
{
os: "win32",
arch: "x64",
avx2: false,
noCa: true,
},
]

const targets = singleFlag
Expand All @@ -136,6 +148,11 @@ const targets = singleFlag
return false
}

// skip no-ca variants for local dev builds
if (item.noCa) {
return false
}

return true
})
: allTargets
Expand All @@ -155,6 +172,7 @@ for (const item of targets) {
item.arch,
item.avx2 === false ? "baseline" : undefined,
item.abi === undefined ? undefined : item.abi,
item.noCa ? "no-ca" : undefined,
]
.filter(Boolean)
.join("-")
Expand All @@ -178,9 +196,9 @@ for (const item of targets) {
autoloadDotenv: false,
autoloadTsconfig: true,
autoloadPackageJson: true,
target: name.replace(pkg.name, "bun") as any,
target: name.replace(pkg.name, "bun").replace("-no-ca", "") as any,
outfile: `dist/${name}/bin/opencode`,
execArgv: [`--user-agent=opencode/${Script.version}`, "--use-system-ca", "--"],
execArgv: [`--user-agent=opencode/${Script.version}`, ...(!item.noCa && process.env.OPENCODE_DISABLE_SYSTEM_CA !== 'true' ? ['--use-system-ca'] : []), "--"],
windows: {},
},
entrypoints: ["./src/index.ts", parserWorker, workerPath],
Expand Down
1 change: 1 addition & 0 deletions packages/opencode/script/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process.chdir(dir)
const binaries: Record<string, string> = {}
for (const filepath of new Bun.Glob("*/package.json").scanSync({ cwd: "./dist" })) {
const pkg = await Bun.file(`./dist/${filepath}`).json()
if (pkg.name.includes("-no-ca")) continue
binaries[pkg.name] = pkg.version
}
console.log("binaries", binaries)
Expand Down
Loading