📦 Chore: add mac-arm64 build support

This commit is contained in:
PiEgg 2022-01-05 12:54:02 +08:00
parent 34b3656605
commit f2a4197ca2
5 changed files with 13 additions and 6 deletions

View File

@ -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 }}

View File

@ -29,4 +29,4 @@ build_script:
- yarn build --win --ia32
- yarn release
test: off
test: false

View File

@ -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> = T extends Promise<infer R> ? R : T
// Cross-process support may be required in the future
class GuiApi implements IGuiApi {

View File

@ -333,3 +333,5 @@ interface IMiniWindowPos {
height: number,
width: number
}
type PromiseResType<T> = T extends Promise<infer R> ? R : T

View File

@ -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',