Skip to content

Commit 5e0c8d6

Browse files
committed
fix arch
1 parent 462bbf5 commit 5e0c8d6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/debug.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
node-version: "20"
4848
cache: pnpm
4949

50+
- name: Setup native dependencies
51+
run: pnpm cap-setup
52+
5053
- name: Install dependencies
5154
run: pnpm install
5255

@@ -59,7 +62,7 @@ jobs:
5962
echo 'VITE_SERVER_URL=${NEXT_PUBLIC_URL}' >> .env
6063
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
6164
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
62-
65+
6366
- name: Copy .env to apps/desktop
6467
run: cp .env apps/desktop/.env
6568

@@ -70,7 +73,6 @@ jobs:
7073
working-directory: apps/desktop
7174
run: |
7275
export TARGET_TRIPLE=aarch64-apple-darwin
73-
node ${{ github.workspace }}/.github/prebuild.js darwin aarch64
7476
pnpm tauri build --target aarch64-apple-darwin --debug
7577
env:
7678
CI: false

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ jobs:
9292
matrix:
9393
settings:
9494
- target: x86_64-apple-darwin
95-
prebuild: x86_64
9695
- target: aarch64-apple-darwin
97-
prebuild: aarch64
9896
steps:
9997
- name: Checkout repository
10098
uses: actions/checkout@v4
@@ -131,6 +129,9 @@ jobs:
131129
node-version: "20"
132130
cache: pnpm
133131

132+
- name: Setup native dependencies
133+
run: pnpm cap-setup
134+
134135
- name: Install dependencies
135136
run: pnpm install
136137

@@ -157,7 +158,6 @@ jobs:
157158
working-directory: apps/desktop
158159
run: |
159160
export TARGET_TRIPLE=${{ matrix.settings.target }}
160-
node ${{ github.workspace }}/.github/prebuild.js darwin ${{ matrix.settings.prebuild }}
161161
pnpm tauri build --target ${{ matrix.settings.target }} --config src-tauri/tauri.conf.prod.json
162162
env:
163163
# https://github.com/tauri-apps/tauri-action/issues/740

scripts/setup.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ const __dirname = path.dirname(__filename);
1414
const __root = path.resolve(path.join(__dirname, ".."));
1515
const targetDir = `${__root}/target`;
1616

17+
const arch = process.arch === "arm64" ? "aarch64" : "x86_64";
18+
1719
async function main() {
1820
if (process.platform === "darwin") {
1921
const NATIVE_DEPS_URL =
2022
"https://github.com/spacedriveapp/native-deps/releases/latest/download";
2123

2224
const NATIVE_DEPS_ASSETS = {
23-
darwin: {
24-
x86_64: "native-deps-x86_64-darwin-apple.tar.xz",
25-
aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
26-
},
25+
x86_64: "native-deps-x86_64-darwin-apple.tar.xz",
26+
aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
2727
};
2828

2929
const nativeDepsTar = `${targetDir}/native-deps.tar.xz`;
3030
if (!(await fileExists(nativeDepsTar))) {
3131
const nativeDepsBytes = await fetch(
32-
`${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS.darwin.aarch64}`
32+
`${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS.darwin[arch]}`
3333
)
3434
.then((r) => r.blob())
3535
.then((b) => b.arrayBuffer());

0 commit comments

Comments
 (0)