From f2a4197ca28ae84ee217f75659986680285121d4 Mon Sep 17 00:00:00 2001 From: PiEgg Date: Wed, 5 Jan 2022 12:54:02 +0800 Subject: [PATCH] :package: Chore: add mac-arm64 build support --- .github/workflows/main.yml | 5 +++-- appveyor.yml | 2 +- src/main/apis/gui/index.ts | 2 -- src/universal/types/types.d.ts | 2 ++ vue.config.js | 8 +++++++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c9a08c..b3ebdae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-10.15] + os: [ubuntu-latest, macos-12] # create steps steps: @@ -50,6 +50,7 @@ jobs: - name: Build & release app run: | - npm run release + yarn build --arm64 + yarn release env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/appveyor.yml b/appveyor.yml index ee103ae..6f36562 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,4 +29,4 @@ build_script: - yarn build --win --ia32 - yarn release -test: off +test: false diff --git a/src/main/apis/gui/index.ts b/src/main/apis/gui/index.ts index fb31aad..4b3d4bc 100644 --- a/src/main/apis/gui/index.ts +++ b/src/main/apis/gui/index.ts @@ -4,7 +4,6 @@ import { Notification, ipcMain } from 'electron' -import path from 'path' import db, { GalleryDB } from 'apis/core/datastore' import { dbPathChecker, defaultConfigPath, getGalleryDBPath } from 'apis/core/datastore/dbChecker' import uploader from 'apis/app/uploader' @@ -18,7 +17,6 @@ import { SHOW_INPUT_BOX } from '~/universal/events/constants' import { DBStore } from '@picgo/store' -type PromiseResType = T extends Promise ? R : T // Cross-process support may be required in the future class GuiApi implements IGuiApi { diff --git a/src/universal/types/types.d.ts b/src/universal/types/types.d.ts index 4cec3b7..8488556 100644 --- a/src/universal/types/types.d.ts +++ b/src/universal/types/types.d.ts @@ -333,3 +333,5 @@ interface IMiniWindowPos { height: number, width: number } + +type PromiseResType = T extends Promise ? R : T diff --git a/vue.config.js b/vue.config.js index bd21ff1..32536f6 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,6 +4,7 @@ function resolve (dir) { } const arch = process.argv.includes('--ia32') ? 'ia32' : 'x64' +const macArch = process.argv.includes('--arm64') ? 'arm64' : 'x64' const config = { configureWebpack: { @@ -65,7 +66,12 @@ const config = { icon: 'build/icons/icon.icns', extendInfo: { LSUIElement: 1 - } + }, + target: [{ + target: 'dmg', + arch: macArch + }], + artifactName: `PicGo-\${version}-${macArch}.dmg` }, win: { icon: 'build/icons/icon.ico',