Fix(build): Fix the issue that on ARM64 Linux failed to launch due to missing better_sqlite3.node (#7002)

This commit is contained in:
Elian Doran 2025-09-16 19:01:55 +03:00 committed by GitHub
commit 23b798e392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 1 deletions

View File

@ -86,6 +86,7 @@ runs:
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
TRILIUM_ARTIFACT_NAME_HINT: TriliumNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}
TARGET_ARCH: ${{ inputs.arch }}
run: pnpm run --filter desktop electron-forge:make --arch=${{ inputs.arch }} --platform=${{ inputs.forge_platform }}
# Add DMG signing step

View File

@ -30,6 +30,19 @@ jobs:
image: win-signing
shell: cmd
forge_platform: win32
# Exclude ARM64 Linux from default matrix to use native runner
exclude:
- arch: arm64
os:
name: linux
# Add ARM64 Linux with native ubuntu-24.04-arm runner for better-sqlite3 compatibility
include:
- arch: arm64
os:
name: linux
image: ubuntu-24.04-arm
shell: bash
forge_platform: linux
runs-on: ${{ matrix.os.image }}
steps:
- uses: actions/checkout@v5

View File

@ -24,13 +24,15 @@ function rebuildNativeDependencies(projectRoot: string) {
process.exit(1);
}
console.log(`Rebuilding ${projectRoot} with ${electronVersion}...`);
const targetArch = process.env.TARGET_ARCH || process.arch;
console.log(`Rebuilding ${projectRoot} with ${electronVersion} for ${targetArch}...`);
const resolvedPath = resolve(projectRoot);
rebuild({
projectRootPath: resolvedPath,
buildPath: resolvedPath,
electronVersion,
arch: targetArch,
force: true
});
}