fix: move node-windows to optionalDependencies to fix Linux CI build

app-builder runs npm install --production inside the app dir during
packaging. node-windows has a Windows-only postinstall script that
fails on Linux with ENOENT. Moving it to optionalDependencies makes
npm treat install failures as non-fatal on non-Windows platforms.

Also simplify build-linux.yml — removes unnecessary app-builder binary
verification steps that were masking the actual root cause.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
SRS IT
2026-03-28 23:56:26 -04:00
parent 7bd3a81bda
commit 37f4a4ea25
2 changed files with 4 additions and 51 deletions
+1 -50
View File
@@ -26,44 +26,9 @@ jobs:
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install -y -qq rpm fakeroot dpkg libarchive-tools sudo apt-get install -y -qq rpm fakeroot dpkg libarchive-tools
- name: Install workspace dependencies (root) - name: Install workspace dependencies
run: npm install --legacy-peer-deps run: npm install --legacy-peer-deps
- name: Debug app-builder binary
run: |
echo "=== Checking root node_modules ==="
ls node_modules/app-builder-bin/ 2>/dev/null && echo "Found in root" || echo "Not in root"
echo "=== Checking apps/desktop node_modules ==="
ls apps/desktop/node_modules/app-builder-bin/ 2>/dev/null && echo "Found in desktop" || echo "Not in desktop"
echo "=== Finding any app-builder binary ==="
find . -name "app-builder" -not -path "*/proc/*" 2>/dev/null | head -10
echo "=== app-builder-bin contents (root) ==="
ls -la node_modules/app-builder-bin/ 2>/dev/null || true
echo "=== app-builder-bin linux dir ==="
ls -la node_modules/app-builder-bin/linux/ 2>/dev/null || true
- name: Verify or download app-builder binary
run: |
# Try root location first (workspace hoisted)
if [ -f "node_modules/app-builder-bin/linux/x64/app-builder" ]; then
echo "Binary found at root, making executable"
chmod +x node_modules/app-builder-bin/linux/x64/app-builder
node_modules/app-builder-bin/linux/x64/app-builder --version
else
echo "Binary not found — installing app-builder-bin directly"
cd node_modules/app-builder-bin && node postinstall.js || true
# Fallback: download manually using the version from package.json
VERSION=$(node -e "console.log(require('./node_modules/app-builder-bin/package.json').version)")
echo "app-builder-bin version: $VERSION"
URL="https://github.com/develar/app-builder/releases/download/v${VERSION}/app-builder_${VERSION}_linux_amd64.tar.gz"
echo "Downloading from: $URL"
mkdir -p node_modules/app-builder-bin/linux/x64
curl -L "$URL" -o /tmp/app-builder.tar.gz
tar -xzf /tmp/app-builder.tar.gz -C node_modules/app-builder-bin/linux/x64/
chmod +x node_modules/app-builder-bin/linux/x64/app-builder
node_modules/app-builder-bin/linux/x64/app-builder --version
fi
- name: Vite build - name: Vite build
run: npx electron-vite build run: npx electron-vite build
working-directory: apps/desktop working-directory: apps/desktop
@@ -72,20 +37,6 @@ jobs:
run: node scripts/bundle-standalone.js run: node scripts/bundle-standalone.js
working-directory: apps/desktop working-directory: apps/desktop
- name: Pre-build binary diagnostics
run: |
BINARY="$(pwd)/node_modules/app-builder-bin/linux/x64/app-builder"
echo "=== Absolute path: $BINARY ==="
ls -la "$BINARY" || echo "MISSING"
echo "=== file output ==="
file "$BINARY" || true
echo "=== ldd output ==="
ldd "$BINARY" || true
echo "=== Execute test ==="
"$BINARY" --version && echo "EXECUTE OK" || echo "EXECUTE FAILED (exit $?)"
echo "=== Checking from apps/desktop context ==="
ls -la "apps/desktop/node_modules/app-builder-bin/linux/x64/app-builder" 2>/dev/null || echo "NOT in apps/desktop"
- name: Build Linux x64 packages - name: Build Linux x64 packages
run: npx electron-builder --linux --x64 run: npx electron-builder --linux --x64
working-directory: apps/desktop working-directory: apps/desktop
+3 -1
View File
@@ -18,13 +18,15 @@
"dependencies": { "dependencies": {
"adm-zip": "^0.5.14", "adm-zip": "^0.5.14",
"axios": "^1.7.0", "axios": "^1.7.0",
"node-windows": "^1.0.0-beta.8",
"sql.js": "^1.12.0", "sql.js": "^1.12.0",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
"ws": "^8.18.0", "ws": "^8.18.0",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"xmlbuilder2": "^4.0.3" "xmlbuilder2": "^4.0.3"
}, },
"optionalDependencies": {
"node-windows": "^1.0.0-beta.8"
},
"devDependencies": { "devDependencies": {
"@vitejs/plugin-react": "^4.3.0", "@vitejs/plugin-react": "^4.3.0",
"electron": "33.4.11", "electron": "33.4.11",