@@ -325,7 +325,15 @@ async function build(hosts, doPackage) {
|
|||||||
const built = []
|
const built = []
|
||||||
const builtEntries = []
|
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) {
|
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, {
|
for await (const file of platform(NATIVE_HOST_DIR, bundle, null, {
|
||||||
name: 'holesail-browser-host',
|
name: 'holesail-browser-host',
|
||||||
version: pkg.version,
|
version: pkg.version,
|
||||||
@@ -337,7 +345,9 @@ async function build(hosts, doPackage) {
|
|||||||
console.log(' Built:', path.relative(ROOT, file))
|
console.log(' Built:', path.relative(ROOT, file))
|
||||||
built.push(file)
|
built.push(file)
|
||||||
builtEntries.push({ file, platformHosts })
|
builtEntries.push({ file, platformHosts })
|
||||||
|
count++
|
||||||
}
|
}
|
||||||
|
console.log(` -> ${count} artifact(s)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doPackage) {
|
if (doPackage) {
|
||||||
@@ -392,17 +402,25 @@ async function createZipArchives(builtEntries) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Group built files by host (from path + platform context) so we create exactly one zip
|
// Group built files by host. When one file serves multiple hosts (e.g. Apple
|
||||||
// per host. platformHosts disambiguates when bare-build uses ABI subdirs (arm64, x86_64)
|
// universal binary for darwin-arm64 + darwin-x64), create a zip for each host
|
||||||
// for both darwin and linux.
|
// with that file so every arch gets a download.
|
||||||
const byHost = new Map()
|
const byHost = new Map()
|
||||||
const hostOrder = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64']
|
const hostOrder = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64']
|
||||||
let fallbackIdx = 0
|
let fallbackIdx = 0
|
||||||
|
|
||||||
for (const { file, platformHosts } of builtEntries) {
|
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)
|
let host = getHostFromBuiltPath(file, platformHosts)
|
||||||
if (!host) host = hostOrder[fallbackIdx++] || 'unknown'
|
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 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 current = byHost.get(host)
|
||||||
const currentRel = current ? path.relative(RELEASES_DIR, current).replace(/\\/g, '/').toLowerCase() : ''
|
const currentRel = current ? path.relative(RELEASES_DIR, current).replace(/\\/g, '/').toLowerCase() : ''
|
||||||
|
|||||||
Reference in New Issue
Block a user