Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix arch

Brendan Allan5e0c8d677433
diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml
index c626b20ce..3e4bb3761 100644
--- a/.github/workflows/debug.yml
+++ b/.github/workflows/debug.yml
@@ -47,6 +47,9 @@ jobs:
node-version: "20"
cache: pnpm
+ - name: Setup native dependencies
+ run: pnpm cap-setup
+
- name: Install dependencies
run: pnpm install
@@ -59,7 +62,7 @@ jobs:
echo 'VITE_SERVER_URL=${NEXT_PUBLIC_URL}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
-
+
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
@@ -70,7 +73,6 @@ jobs:
working-directory: apps/desktop
run: |
export TARGET_TRIPLE=aarch64-apple-darwin
- node ${{ github.workspace }}/.github/prebuild.js darwin aarch64
pnpm tauri build --target aarch64-apple-darwin --debug
env:
CI: false
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 9c84720e6..0442634f7 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -92,9 +92,7 @@ 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
@@ -131,6 +129,9 @@ jobs:
node-version: "20"
cache: pnpm
+ - name: Setup native dependencies
+ run: pnpm cap-setup
+
- name: Install dependencies
run: pnpm install
@@ -157,7 +158,6 @@ 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 83088674e..d131ae218 100644
--- a/scripts/setup.js
+++ b/scripts/setup.js
@@ -14,22 +14,22 @@ const __dirname = path.dirname(__filename);
const __root = path.resolve(path.join(__dirname, ".."));
const targetDir = `${__root}/target`;
+const arch = process.arch === "arm64" ? "aarch64" : "x86_64";
+
async function main() {
if (process.platform === "darwin") {
const NATIVE_DEPS_URL =
"https://github.com/spacedriveapp/native-deps/releases/latest/download";
const NATIVE_DEPS_ASSETS = {
- darwin: {
- x86_64: "native-deps-x86_64-darwin-apple.tar.xz",
- aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
- },
+ x86_64: "native-deps-x86_64-darwin-apple.tar.xz",
+ aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
};
const nativeDepsTar = `${targetDir}/native-deps.tar.xz`;
if (!(await fileExists(nativeDepsTar))) {
const nativeDepsBytes = await fetch(
- `${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS.darwin.aarch64}`
+ `${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS.darwin[arch]}`
)
.then((r) => r.blob())
.then((b) => b.arrayBuffer());