From 79e16c6af1e87cb0de23d8e89def5280de9790b6 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Mon, 27 Jan 2025 23:00:02 +0800 Subject: [PATCH] use prebuild script for now --- .github/prebuild.js | 4 ++-- .github/workflows/publish.yml | 6 +++--- scripts/setup.js | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/prebuild.js b/.github/prebuild.js index a3a8da1c..e70a5359 100644 --- a/.github/prebuild.js +++ b/.github/prebuild.js @@ -98,7 +98,7 @@ rustflags = [ recursive: true, }); - await signMacOSFrameworkLibs(nativeDeps).catch((e) => { + await symlinkSharedLibsMacOS(nativeDeps).catch((e) => { console.error(`Failed to symlink shared libs.`); throw e; }); @@ -146,7 +146,7 @@ const NATIVE_DEPS_ASSETS = { }, }; -async function signMacOSFrameworkLibs(nativeDeps) { +async function symlinkSharedLibsMacOS(nativeDeps) { // Framework const framework = path.join(nativeDeps, "Spacedrive.framework"); diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0442634f..9c84720e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -92,7 +92,9 @@ jobs: matrix: settings: - target: x86_64-apple-darwin + prebuild: x86_64 - target: aarch64-apple-darwin + prebuild: aarch64 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -129,9 +131,6 @@ jobs: node-version: "20" cache: pnpm - - name: Setup native dependencies - run: pnpm cap-setup - - name: Install dependencies run: pnpm install @@ -158,6 +157,7 @@ jobs: working-directory: apps/desktop run: | export TARGET_TRIPLE=${{ matrix.settings.target }} + node ${{ github.workspace }}/.github/prebuild.js darwin ${{ matrix.settings.prebuild }} pnpm tauri build --target ${{ matrix.settings.target }} --config src-tauri/tauri.conf.prod.json env: # https://github.com/tauri-apps/tauri-action/issues/740 diff --git a/scripts/setup.js b/scripts/setup.js index d4a9db25..a5a4e79d 100644 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -26,6 +26,8 @@ async function main() { aarch64: "native-deps-aarch64-darwin-apple.tar.xz", }; + await fs.mkdir(targetDir, { recursive: true }); + const nativeDepsTar = `${targetDir}/native-deps.tar.xz`; if (!(await fileExists(nativeDepsTar))) { const nativeDepsBytes = await fetch(