fix(ci): ensure Linux electron binary, pass electronDist per-platform
Build and Release / build-and-release (push) Failing after 4m8s
Build and Release / build-and-release (push) Failing after 4m8s
electron-nightly may not auto-download the Linux binary on CI. Add explicit step to trigger download if missing. Pass electronDist as CLI override per-platform (dist-win for Windows, dist for Linux) instead of in config. Write path.txt on all platforms like KPC.
This commit is contained in:
@@ -56,18 +56,22 @@ jobs:
|
|||||||
if: steps.version-check.outputs.SKIP == 'false'
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
run: npm ci --legacy-peer-deps
|
run: npm ci --legacy-peer-deps
|
||||||
|
|
||||||
|
- name: Ensure Electron Linux binary
|
||||||
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
|
run: |
|
||||||
|
if [ ! -f node_modules/electron/dist/electron ]; then
|
||||||
|
echo "Electron Linux binary not found in dist/, triggering download..."
|
||||||
|
node node_modules/electron/install.js
|
||||||
|
fi
|
||||||
|
echo "=== Electron binaries ==="
|
||||||
|
echo "dist/electron: $(ls -lh node_modules/electron/dist/electron 2>/dev/null || echo MISSING)"
|
||||||
|
echo "dist-win/electron.exe: $(ls -lh node_modules/electron/dist-win/electron.exe 2>/dev/null || echo MISSING)"
|
||||||
|
echo "path.txt: $(cat node_modules/electron/path.txt 2>/dev/null || echo MISSING)"
|
||||||
|
|
||||||
- name: Build source
|
- name: Build source
|
||||||
if: steps.version-check.outputs.SKIP == 'false'
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Verify Electron binaries
|
|
||||||
if: steps.version-check.outputs.SKIP == 'false'
|
|
||||||
run: |
|
|
||||||
echo "=== Electron dist (stock, for Linux build) ==="
|
|
||||||
ls node_modules/electron/dist/electron 2>/dev/null && echo "OK" || echo "MISSING"
|
|
||||||
echo "=== Electron dist-win (patched, for Windows build) ==="
|
|
||||||
ls node_modules/electron/dist-win/electron.exe 2>/dev/null && echo "OK" || echo "MISSING"
|
|
||||||
|
|
||||||
- name: Build Windows distributables
|
- name: Build Windows distributables
|
||||||
if: steps.version-check.outputs.SKIP == 'false'
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
env:
|
env:
|
||||||
@@ -76,7 +80,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Linux distributables
|
- name: Build Linux distributables
|
||||||
if: steps.version-check.outputs.SKIP == 'false'
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
run: npx electron-builder --linux --publish never
|
run: npx electron-builder --linux -c.electronDist=node_modules/electron/dist --publish never
|
||||||
|
|
||||||
- name: Report build sizes
|
- name: Report build sizes
|
||||||
if: steps.version-check.outputs.SKIP == 'false'
|
if: steps.version-check.outputs.SKIP == 'false'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
appId: com.krunkercivilian.client
|
appId: com.krunkercivilian.client
|
||||||
productName: Krunker Civilian Client
|
productName: Krunker Civilian Client
|
||||||
electronDist: node_modules/electron/dist
|
|
||||||
directories:
|
directories:
|
||||||
output: out
|
output: out
|
||||||
buildResources: build
|
buildResources: build
|
||||||
|
|||||||
@@ -151,11 +151,8 @@ async function main() {
|
|||||||
|
|
||||||
// Write path.txt so the electron package's lazy downloader (index.js)
|
// Write path.txt so the electron package's lazy downloader (index.js)
|
||||||
// considers the binary already installed and doesn't re-download stock.
|
// considers the binary already installed and doesn't re-download stock.
|
||||||
// On non-Windows (CI cross-compilation), skip this so electron-nightly still
|
const platformExe = IS_WIN ? 'electron.exe' : 'electron';
|
||||||
// downloads the native Linux binary into dist/ for the Linux build target.
|
fs.writeFileSync(path.join(ELECTRON_DIST, '..', 'path.txt'), platformExe);
|
||||||
if (IS_WIN) {
|
|
||||||
fs.writeFileSync(path.join(ELECTRON_DIST, '..', 'path.txt'), 'electron.exe');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write marker and verify
|
// Write marker and verify
|
||||||
if (fs.existsSync(VERSION_FILE)) {
|
if (fs.existsSync(VERSION_FILE)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user