From 1240afa468aad604159605beb5879d8f6a4cb5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Thu, 9 Mar 2023 14:15:46 +0800 Subject: [PATCH] :bug: Fix: fix sharp build error on MacOS M1 chip --- .github/workflows/main.yml | 20 ++++++++++++++++---- package.json | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c22f15..759b4f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,10 +42,7 @@ jobs: if: matrix.os == 'macos-11' run: | CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH # step2: install node env - name: Install Node.js @@ -60,7 +57,22 @@ jobs: # step3: yarn - - name: Yarn install + - name: Yarn install macos + if: matrix.os = 'macos-11' + run: | + yarn + yarn global add xvfb-maybe + npm rebuild --platform=darwin --arch=arm64 sharp + + - name: Yarn install windows + if: matrix.os = 'windows-latest' + run: | + yarn + yarn global add xvfb-maybe + npm rebuild --platform=win32 --arch=ia32 sharp + + - name: Yarn install linux + if: matrix.os = 'ubuntu-latest' run: | yarn yarn global add xvfb-maybe diff --git a/package.json b/package.json index ceca5b8..090afe3 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "pinia-plugin-persistedstate": "^3.1.0", "qiniu": "^7.8.0", "qrcode.vue": "^3.3.3", + "sharp": "^0.31.3", "shell-path": "2.1.0", "upyun": "^3.4.6", "uuid": "^9.0.0",