@@ -43,13 +43,10 @@ jobs:
4343 include :
4444 - os : ubuntu-22.04
4545 platform : linux
46- electron_platform : linux
4746 - os : windows-latest
4847 platform : win
49- electron_platform : win
5048 - os : macos-14
5149 platform : mac
52- electron_platform : mac
5350
5451 runs-on : ${{ matrix.os }}
5552
@@ -69,100 +66,57 @@ jobs:
6966 node-version : ' 22'
7067 cache : ' npm'
7168
72- - name : Install dependencies (Windows)
73- if : matrix.os == 'windows-latest'
74- shell : pwsh
69+ - name : Install dependencies
7570 run : |
76- npm cache clean --force
77- npm install --no-audit --no-fund
71+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
72+ npm cache clean --force
73+ npm install --no-audit --no-fund
74+ else
75+ npm ci
76+ fi
7877
79- - name : Install dependencies (Linux/Mac)
80- if : matrix.os != 'windows-latest'
81- run : npm ci
82-
83- - name : Build frontend with Vite (Windows)
84- if : matrix.os == 'windows-latest'
85- shell : pwsh
86- run : npm run build:ui
87-
88- - name : Build frontend with Vite (Linux/Mac)
89- if : matrix.os != 'windows-latest'
90- run : npm run build:ui
91-
92- - name : Copy Electron source files (Linux/Mac)
93- if : matrix.os != 'windows-latest'
94- run : |
95- mkdir -p appsrc/electron
96- mkdir -p appsrc/locale
97- cp -r src/electron/* appsrc/electron/ || echo "No electron files to copy"
98- cp -r locale/* appsrc/locale/ 2>/dev/null || echo "No locale files to copy"
99- echo "✅ Source files copied to appsrc/"
100-
101- - name : Copy Electron source files (Windows)
102- if : matrix.os == 'windows-latest'
103- shell : pwsh
78+ - name : Verify build script exists
10479 run : |
105- New-Item -ItemType Directory -Force -Path "appsrc\electron"
106- New-Item -ItemType Directory -Force -Path "appsrc\locale"
107- if (Test-Path "src\electron") {
108- Copy-Item -Recurse -Path "src\electron\*" -Destination "appsrc\electron\" -Force
109- Write-Host "✅ Electron files copied"
110- } else {
111- Write-Host "No electron files to copy"
112- }
113- if (Test-Path "locale") {
114- Copy-Item -Recurse -Path "locale\*" -Destination "appsrc\locale\" -Force
115- Write-Host "✅ Locale files copied"
116- } else {
117- Write-Host "No locale files to copy"
118- }
119-
120- - name : Rebuild native modules (Linux/Mac)
121- if : matrix.os != 'windows-latest'
122- run : npm run rebuild
123-
124- - name : Skip rebuild (Windows)
125- if : matrix.os == 'windows-latest'
126- shell : pwsh
127- run : Write-Host "Skipping rebuild on Windows to avoid timeout issues"
128-
129- - name : Build Electron app (Windows)
130- if : matrix.os == 'windows-latest'
131- shell : pwsh
132- env :
133- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134- run : npx electron-builder --win --x64
135-
136- - name : Build Electron app (Linux)
137- if : matrix.os == 'ubuntu-22.04'
138- env :
139- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
140- run : npx electron-builder --linux --x64 -c.linux.target=AppImage
141-
142- - name : Build Electron app (Mac)
143- if : matrix.os == 'macos-14'
80+ echo "Checking if build.js exists..."
81+ if [ -f "build.js" ]; then
82+ echo "✅ build.js found"
83+ echo "Script content preview:"
84+ head -20 build.js
85+ else
86+ echo "❌ build.js not found!"
87+ exit 1
88+ fi
89+
90+ - name : Test build script syntax
91+ run : node -c build.js
92+
93+ - name : Build Electron app with custom script
14494 env :
14595 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146- run : npx electron-builder --mac --universal
147-
148- - name : List build artifacts (Windows)
149- if : matrix.os == 'windows-latest'
150- shell : pwsh
15196 run : |
152- Write-Host "📁 Build directory contents:"
153- Get-ChildItem -Path "build" -ErrorAction SilentlyContinue | ForEach-Object { Write-Host $_.Name }
154- Write-Host ""
155- Write-Host "📁 Dist directory contents:"
156- Get-ChildItem -Path "dist" -ErrorAction SilentlyContinue | ForEach-Object { Write-Host $_.Name }
97+ echo "Running custom build script for ${{ matrix.platform }}..."
98+ node build.js --build=platform
99+
100+ # Verify build output
101+ echo "Build output verification:"
102+ if [ -d "build" ]; then
103+ echo "✅ Build directory created"
104+ ls -la build/
105+ else
106+ echo "❌ No build directory found!"
107+ exit 1
108+ fi
157109
158- - name : List build artifacts (Linux/Mac)
159- if : matrix.os != 'windows-latest'
110+ - name : List final artifacts
160111 run : |
112+ echo "📦 Final artifacts:"
113+ find . -name "*.exe" -o -name "*.dmg" -o -name "*.AppImage" -o -name "*.zip" | grep -v node_modules || echo "No distributable files found"
114+ echo ""
161115 echo "📁 Build directory contents:"
162- ls -la build/ 2>/dev/null || echo "No build directory found "
116+ ls -la build/ 2>/dev/null || echo "No build directory"
163117 echo ""
164118 echo "📁 Dist directory contents:"
165- ls -la dist/ 2>/dev/null || echo "No dist directory found "
119+ ls -la dist/ 2>/dev/null || echo "No dist directory"
166120
167121 - name : Upload build artifacts
168122 uses : actions/upload-artifact@v4
@@ -171,4 +125,4 @@ jobs:
171125 path : |
172126 build/*
173127 dist/*
174- retention-days : 30
128+ retention-days : 30
0 commit comments