Builder
CI / Build & Test (push) Successful in 3m54s

This commit is contained in:
Raven Scott
2026-03-04 00:37:28 -05:00
parent b03f67b126
commit f9976559bf
+22 -4
View File
@@ -325,7 +325,15 @@ async function build(hosts, doPackage) {
const built = []
const builtEntries = []
const platformLabels = new Map()
platformLabels.set(getPlatformModule('darwin-arm64'), 'Apple (darwin)')
platformLabels.set(getPlatformModule('linux-arm64'), 'Linux')
platformLabels.set(getPlatformModule('win32-x64'), 'Windows')
for (const [platform, platformHosts] of groups) {
const label = platformLabels.get(platform) || 'Unknown'
console.log(` Building ${label} (${platformHosts.join(', ')})...`)
let count = 0
for await (const file of platform(NATIVE_HOST_DIR, bundle, null, {
name: 'holesail-browser-host',
version: pkg.version,
@@ -337,7 +345,9 @@ async function build(hosts, doPackage) {
console.log(' Built:', path.relative(ROOT, file))
built.push(file)
builtEntries.push({ file, platformHosts })
count++
}
console.log(` -> ${count} artifact(s)`)
}
if (doPackage) {
@@ -392,17 +402,25 @@ async function createZipArchives(builtEntries) {
return
}
// Group built files by host (from path + platform context) so we create exactly one zip
// per host. platformHosts disambiguates when bare-build uses ABI subdirs (arm64, x86_64)
// for both darwin and linux.
// Group built files by host. When one file serves multiple hosts (e.g. Apple
// universal binary for darwin-arm64 + darwin-x64), create a zip for each host
// with that file so every arch gets a download.
const byHost = new Map()
const hostOrder = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64']
let fallbackIdx = 0
for (const { file, platformHosts } of builtEntries) {
const rel = path.relative(RELEASES_DIR, file).replace(/\\/g, '/').toLowerCase()
const hasArchSubdir = rel.includes('aarch64/') || rel.includes('x86_64/') || rel.includes('arm64/') || rel.includes('linux-') || rel.includes('win32') || rel.endsWith('.exe')
if (!hasArchSubdir && platformHosts && platformHosts.length > 1) {
// Universal binary (e.g. Apple fat binary): one file for all platformHosts
for (const h of platformHosts) {
if (!byHost.has(h)) byHost.set(h, file)
}
continue
}
let host = getHostFromBuiltPath(file, platformHosts)
if (!host) host = hostOrder[fallbackIdx++] || 'unknown'
const rel = path.relative(RELEASES_DIR, file).replace(/\\/g, '/').toLowerCase()
const isArchSpecific = rel.includes('/') && (rel.includes('aarch64') || rel.includes('x86_64') || rel.includes('arm64') || rel.includes('linux-') || rel.includes('win32') || rel.endsWith('.exe'))
const current = byHost.get(host)
const currentRel = current ? path.relative(RELEASES_DIR, current).replace(/\\/g, '/').toLowerCase() : ''