trilium/.github/workflows/test-arm64-fix.yml
linull c77b7f8c74 Add detailed better_sqlite3.node checking
- Check exact path: app.asar.unpacked/node_modules/better-sqlite3/build/Release/
- Verify file existence and architecture
- Upload artifacts for manual inspection
2025-09-16 21:35:50 +08:00

74 lines
2.6 KiB
YAML

name: Test ARM64 Fix
on:
push:
branches: [ fix-arm64-sqlite ]
workflow_dispatch:
jobs:
test-arm64-rebuild:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test rebuild with TARGET_ARCH
env:
TARGET_ARCH: arm64
run: |
echo "Testing electron-rebuild with TARGET_ARCH=arm64"
pnpm postinstall
echo "Checking better-sqlite3 architecture:"
file apps/desktop/node_modules/better-sqlite3/build/Release/better_sqlite3.node || echo "File not found"
- name: Build desktop package
env:
TARGET_ARCH: arm64
run: |
echo "Building desktop package for ARM64"
pnpm run --filter desktop electron-forge:make --arch=arm64 --platform=linux
- name: Check better-sqlite3 in package
run: |
echo "=== Checking built packages ==="
find apps/desktop/out -type f | head -10
echo "\n=== Extracting and checking better-sqlite3 ==="
cd apps/desktop/out
# Find the built package
PACKAGE=$(find . -name "*.deb" | head -1)
if [ -n "$PACKAGE" ]; then
echo "Found DEB package: $PACKAGE"
dpkg-deb -x "$PACKAGE" extracted/
echo "\n=== Checking target path ==="
TARGET_PATH="extracted/opt/Trilium Notes/resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node"
if [ -f "$TARGET_PATH" ]; then
echo "✅ Found better_sqlite3.node at expected path"
echo "File info:"
file "$TARGET_PATH"
ls -la "$TARGET_PATH"
else
echo "❌ better_sqlite3.node NOT found at expected path"
echo "Searching for better-sqlite3 files:"
find extracted/ -name "*sqlite*" -type f
echo "\nSearching for .node files:"
find extracted/ -name "*.node" -type f
fi
else
echo "No DEB package found, checking dist directory:"
find ../dist -name "better_sqlite3.node" -exec file {} \; 2>/dev/null || echo "No .node files in dist"
fi
- name: Upload built package
uses: actions/upload-artifact@v4
if: always()
with:
name: trilium-arm64-linux-test
path: |
apps/desktop/out/*
apps/desktop/dist/*