📦 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: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-10.15] os: [ubuntu-latest, macos-12]
# create steps # create steps
steps: steps:
@ -50,6 +50,7 @@ jobs:
- name: Build & release app - name: Build & release app
run: | run: |
npm run release yarn build --arm64
yarn release
env: env:
GH_TOKEN: ${{ secrets.GH_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }}

View File

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

View File

@ -4,7 +4,6 @@ import {
Notification, Notification,
ipcMain ipcMain
} from 'electron' } from 'electron'
import path from 'path'
import db, { GalleryDB } from 'apis/core/datastore' import db, { GalleryDB } from 'apis/core/datastore'
import { dbPathChecker, defaultConfigPath, getGalleryDBPath } from 'apis/core/datastore/dbChecker' import { dbPathChecker, defaultConfigPath, getGalleryDBPath } from 'apis/core/datastore/dbChecker'
import uploader from 'apis/app/uploader' import uploader from 'apis/app/uploader'
@ -18,7 +17,6 @@ import {
SHOW_INPUT_BOX SHOW_INPUT_BOX
} from '~/universal/events/constants' } from '~/universal/events/constants'
import { DBStore } from '@picgo/store' import { DBStore } from '@picgo/store'
type PromiseResType<T> = T extends Promise<infer R> ? R : T
// Cross-process support may be required in the future // Cross-process support may be required in the future
class GuiApi implements IGuiApi { class GuiApi implements IGuiApi {

View File

@ -333,3 +333,5 @@ interface IMiniWindowPos {
height: number, height: number,
width: 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 arch = process.argv.includes('--ia32') ? 'ia32' : 'x64'
const macArch = process.argv.includes('--arm64') ? 'arm64' : 'x64'
const config = { const config = {
configureWebpack: { configureWebpack: {
@ -65,7 +66,12 @@ const config = {
icon: 'build/icons/icon.icns', icon: 'build/icons/icon.icns',
extendInfo: { extendInfo: {
LSUIElement: 1 LSUIElement: 1
} },
target: [{
target: 'dmg',
arch: macArch
}],
artifactName: `PicGo-\${version}-${macArch}.dmg`
}, },
win: { win: {
icon: 'build/icons/icon.ico', icon: 'build/icons/icon.ico',