mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-13 15:46:22 +00:00
fix: skip windows exe patching in ci mode to avoid wine dependency (#645)
The server release CI workflow fails on ubuntu-latest because patch-windows-exe.ts requires Wine to run rcedit. Thread the existing --ci flag through compileServerBinaries so Windows PE metadata patching is skipped in CI mode with a warning log.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { mkdirSync, rmSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
|
||||
import { log } from '../log'
|
||||
import { wasmBinaryPlugin } from '../plugins/wasm-binary'
|
||||
import { runCommand } from './command'
|
||||
import type { BuildTarget, CompiledServerBinary } from './types'
|
||||
@@ -52,6 +53,7 @@ async function bundleServer(
|
||||
async function compileTarget(
|
||||
target: BuildTarget,
|
||||
env: NodeJS.ProcessEnv,
|
||||
ci: boolean,
|
||||
): Promise<string> {
|
||||
const binaryPath = compiledBinaryPath(target)
|
||||
const args = [
|
||||
@@ -66,11 +68,15 @@ async function compileTarget(
|
||||
await runCommand('bun', args, env)
|
||||
|
||||
if (target.os === 'windows') {
|
||||
await runCommand(
|
||||
'bun',
|
||||
['scripts/patch-windows-exe.ts', binaryPath],
|
||||
process.env,
|
||||
)
|
||||
if (ci) {
|
||||
log.warn('Skipping Windows exe metadata patching in CI mode')
|
||||
} else {
|
||||
await runCommand(
|
||||
'bun',
|
||||
['scripts/patch-windows-exe.ts', binaryPath],
|
||||
process.env,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return binaryPath
|
||||
@@ -81,14 +87,16 @@ export async function compileServerBinaries(
|
||||
envVars: Record<string, string>,
|
||||
processEnv: NodeJS.ProcessEnv,
|
||||
version: string,
|
||||
options?: { ci?: boolean },
|
||||
): Promise<CompiledServerBinary[]> {
|
||||
const ci = options?.ci ?? false
|
||||
rmSync(TMP_ROOT, { recursive: true, force: true })
|
||||
mkdirSync(BINARIES_DIR, { recursive: true })
|
||||
await bundleServer(envVars, version)
|
||||
|
||||
const compiled: CompiledServerBinary[] = []
|
||||
for (const target of targets) {
|
||||
const binaryPath = await compileTarget(target, processEnv)
|
||||
const binaryPath = await compileTarget(target, processEnv, ci)
|
||||
compiled.push({ target, binaryPath })
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ export async function runProdResourceBuild(argv: string[]): Promise<void> {
|
||||
buildConfig.envVars,
|
||||
buildConfig.processEnv,
|
||||
buildConfig.version,
|
||||
{ ci: args.ci },
|
||||
)
|
||||
|
||||
if (args.ci) {
|
||||
|
||||
Reference in New Issue
Block a user