Merge branch 'main' into fix_windows_utf_encoding

This commit is contained in:
Wendong-Fan 2026-01-22 10:08:51 +08:00 committed by GitHub
commit d24664686d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 117 additions and 18 deletions

View file

@ -14,31 +14,45 @@ jobs:
strategy:
matrix:
include:
- os: warp-macos-15-arm64-12x
- os: [self-hosted, macOS, ARM64]
arch: arm64
artifact_name: macos-arm64
- os: windows-latest
arch: x64
artifact_name: windows-latest
- os: ubuntu-latest
arch: x64
artifact_name: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
clean: true
# Clean node_modules on self-hosted runner to ensure fresh install
- name: Clean node_modules (self-hosted)
if: contains(matrix.os, 'self-hosted')
run: |
rm -rf node_modules
rm -rf release
- name: Setup Node.js
if: "!contains(matrix.os, 'self-hosted')"
uses: actions/setup-node@v6
with:
node-version: 20
- name: Setup Python
if: "!contains(matrix.os, 'self-hosted')"
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install uv
python3 -m pip install --upgrade pip
pip3 install uv
- name: Install bun
run: npm install -g bun
@ -46,6 +60,20 @@ jobs:
- name: Install Dependencies
run: npm install
# Verify Electron installation on macOS
- name: Verify Electron Installation (macOS)
if: runner.os == 'macOS'
run: |
echo "Checking Electron installation..."
ls -la node_modules/electron/dist/ || echo "Electron dist not found"
if [ -d "node_modules/electron/dist/Electron.app" ]; then
echo "✅ Electron.app found"
ls -la "node_modules/electron/dist/Electron.app/Contents/Frameworks/" | head -5
else
echo "❌ Electron.app NOT found - this will cause build failure"
exit 1
fi
# Install libfuse2 for Linux AppImage builds
- name: Install libfuse2 (Linux)
if: runner.os == 'Linux'
@ -78,7 +106,6 @@ jobs:
run: npm run build -- --arch ${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Signing variables (CSC_LINK, CSC_KEY_PASSWORD) are omitted for Windows
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
@ -98,11 +125,34 @@ jobs:
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
USE_NPM_INSTALL_BUN: 'true'
# Verify built app contains Electron Framework
- name: Verify Built App (macOS)
if: runner.os == 'macOS'
run: |
echo "Checking built app..."
APP_PATH=$(find release -name "*.app" -type d | head -1)
if [ -n "$APP_PATH" ]; then
echo "Found app at: $APP_PATH"
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
if [ -d "$FRAMEWORKS_PATH/Electron Framework.framework" ]; then
echo "✅ Electron Framework found"
ls -la "$FRAMEWORKS_PATH/" | head -10
else
echo "❌ Electron Framework NOT found in built app!"
echo "Contents of Frameworks directory:"
ls -la "$FRAMEWORKS_PATH/" 2>/dev/null || echo "Frameworks directory does not exist"
exit 1
fi
else
echo "No .app found in release directory"
ls -la release/
fi
- name: Upload Artifact (macOS - dmg only)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
name: release-${{ matrix.artifact_name }}-${{ matrix.arch }}
path: |
release/*.dmg
retention-days: 5
@ -111,7 +161,7 @@ jobs:
if: runner.os == 'Windows'
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
name: release-${{ matrix.artifact_name }}-${{ matrix.arch }}
path: |
release/*.exe
retention-days: 5
@ -120,7 +170,7 @@ jobs:
if: runner.os == 'Linux'
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
name: release-${{ matrix.artifact_name }}-${{ matrix.arch }}
path: |
release/*.AppImage
retention-days: 5
@ -135,7 +185,7 @@ jobs:
- name: Download mac-arm64 artifact
uses: actions/download-artifact@v7
with:
name: release-warp-macos-15-arm64-6x-arm64
name: release-macos-arm64-arm64
path: temp-mac-arm64
- name: Download win-x64 artifact

View file

@ -25,35 +25,63 @@ jobs:
strategy:
matrix:
include:
- os: warp-macos-15-arm64-12x
- os: [self-hosted, macOS, ARM64]
arch: arm64
artifact_name: macos-arm64
- os: windows-latest
arch: x64
artifact_name: windows-latest
- os: ubuntu-latest
arch: x64
artifact_name: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
clean: true
# Clean node_modules on self-hosted runner to ensure fresh install
- name: Clean node_modules (self-hosted)
if: contains(matrix.os, 'self-hosted')
run: |
rm -rf node_modules
rm -rf release
- name: Setup Node.js
if: "!contains(matrix.os, 'self-hosted')"
uses: actions/setup-node@v6
with:
node-version: 20
- name: Setup Python
if: "!contains(matrix.os, 'self-hosted')"
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install uv
python3 -m pip install --upgrade pip
pip3 install uv
- name: Install Dependencies
run: npm install
# Verify Electron installation on macOS
- name: Verify Electron Installation (macOS)
if: runner.os == 'macOS'
run: |
echo "Checking Electron installation..."
ls -la node_modules/electron/dist/ || echo "Electron dist not found"
if [ -d "node_modules/electron/dist/Electron.app" ]; then
echo "✅ Electron.app found"
ls -la "node_modules/electron/dist/Electron.app/Contents/Frameworks/" | head -5
else
echo "❌ Electron.app NOT found - this will cause build failure"
exit 1
fi
# Install libfuse2 for Linux AppImage builds
- name: Install libfuse2 (Linux)
if: runner.os == 'Linux'
@ -83,7 +111,6 @@ jobs:
run: npm run build -- --arch ${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Signing variables (CSC_LINK, CSC_KEY_PASSWORD) are omitted for Windows
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
@ -100,10 +127,33 @@ jobs:
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
# Verify built app contains Electron Framework
- name: Verify Built App (macOS)
if: runner.os == 'macOS'
run: |
echo "Checking built app..."
APP_PATH=$(find release -name "*.app" -type d | head -1)
if [ -n "$APP_PATH" ]; then
echo "Found app at: $APP_PATH"
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
if [ -d "$FRAMEWORKS_PATH/Electron Framework.framework" ]; then
echo "✅ Electron Framework found"
ls -la "$FRAMEWORKS_PATH/" | head -10
else
echo "❌ Electron Framework NOT found in built app!"
echo "Contents of Frameworks directory:"
ls -la "$FRAMEWORKS_PATH/" 2>/dev/null || echo "Frameworks directory does not exist"
exit 1
fi
else
echo "No .app found in release directory"
ls -la release/
fi
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
name: release-${{ matrix.artifact_name }}-${{ matrix.arch }}
path: |
release/*
!release/builder-debug.yml
@ -120,7 +170,7 @@ jobs:
- name: Download mac-arm64 artifact
uses: actions/download-artifact@v7
with:
name: release-warp-macos-15-arm64-6x-arm64
name: release-macos-arm64-arm64
path: temp-mac-arm64
- name: Download win-x64 artifact

View file

@ -225,14 +225,13 @@ export async function startBackend(setPort?: (port: number) => void): Promise<an
log.warn(`Failed to remove lock file: ${e}`);
}
// Cleanup corrupted python cache ONLY if we don't have bundled Python
// Cleanup corrupted python cache ONLY if it's not the bundled Python
// If we have bundled Python, we want to keep it and reuse it
const prebuiltPythonDir = getPrebuiltPythonDir();
try {
const pythonCacheDir = getCachePath('uv_python');
// Only remove cache if we DON'T have prebuilt Python available
// When prebuilt Python exists, UV will use it via UV_PYTHON_INSTALL_DIR
if (fs.existsSync(pythonCacheDir) && !prebuiltPythonDir) {
// Only remove if it's NOT the prebuilt Python directory
if (fs.existsSync(pythonCacheDir) && pythonCacheDir !== prebuiltPythonDir) {
log.info(`Removing potentially corrupted Python cache: ${pythonCacheDir}`);
fs.rmSync(pythonCacheDir, { recursive: true, force: true });
} else if (prebuiltPythonDir) {