ci: attempt to fix
Some checks failed
Queue Release Build / prepare (push) Successful in 18s
Deploy Web Apps / deploy (push) Successful in 10m50s
Queue Release Build / build-windows (push) Failing after 5m41s
Queue Release Build / build-linux (push) Successful in 22m46s
Queue Release Build / finalize (push) Has been skipped

This commit is contained in:
2026-04-12 17:34:35 +02:00
parent 878fd1c766
commit ed53911178
3 changed files with 30 additions and 12 deletions

View File

@@ -184,23 +184,33 @@ jobs:
# because their resolved path sits outside the package root.
New-Item -ItemType Directory -Path $electronBuilderWorkspace | Out-Null
# Point electron-builder at the Electron binary already present
# in the main workspace so the packaging workspace can skip it.
$env:ELECTRON_OVERRIDE_DIST_PATH = Join-Path $projectRoot 'node_modules\electron\dist'
try {
Copy-Item -Path (Join-Path $projectRoot 'package.json') -Destination (Join-Path $electronBuilderWorkspace 'package.json') -Force
Copy-Item -Path (Join-Path $projectRoot 'package-lock.json') -Destination (Join-Path $electronBuilderWorkspace 'package-lock.json') -Force
# Write a trimmed package.json listing only electron main-process
# runtime deps. electron-builder v26 runs `npm ls` to build the
# dep graph — if it sees Angular/mermaid/etc. it tries to resolve
# them, fails, and crashes with "dependency path is undefined".
$trimmedPkgPath = Join-Path $electronBuilderWorkspace 'package.json'
node -e "var p=require('./package.json'),k='auto-launch electron-updater reflect-metadata sql.js typeorm uuid tslib'.split(' '),d={};k.forEach(function(n){if(p.dependencies[n])d[n]=p.dependencies[n]});p.dependencies=d;p.devDependencies={};require('fs').writeFileSync(process.argv[1],JSON.stringify(p,null,2))" "$trimmedPkgPath"
Invoke-RoboCopy (Join-Path $projectRoot 'dist') (Join-Path $electronBuilderWorkspace 'dist')
Invoke-RoboCopy (Join-Path $projectRoot 'images') (Join-Path $electronBuilderWorkspace 'images')
Push-Location $electronBuilderWorkspace
$locationPushed = $true
# Install only production dependencies — much faster than
# mirroring the full node_modules tree via robocopy and also
# avoids the junction/symlink issues that require the temp workspace.
npm ci --omit=dev --ignore-scripts
# Install only the 7 runtime deps + their transitive closure (~50 MB).
# This gives electron-builder a clean, complete dep tree so its
# NpmNodeModulesCollector won't hit missing-path errors.
npm install --ignore-scripts 2>&1 | Select-String -NotMatch '^npm warn'
# electron-builder needs the electron package to read the version,
# but npm install won't fetch it (not in trimmed deps). Copy just
# the package.json so it can resolve the version string, and point
# ELECTRON_OVERRIDE_DIST_PATH at the real binary in the main tree.
$destElectron = Join-Path $electronBuilderWorkspace 'node_modules\electron'
New-Item -ItemType Directory -Path $destElectron -Force | Out-Null
Copy-Item -Path (Join-Path $projectRoot 'node_modules\electron\package.json') -Destination (Join-Path $destElectron 'package.json') -Force
$env:ELECTRON_OVERRIDE_DIST_PATH = Join-Path $projectRoot 'node_modules\electron\dist'
$electronBuilderBin = Join-Path $projectRoot 'node_modules\.bin\electron-builder.cmd'
& $electronBuilderBin --win --publish never