Merge pull request #2255 from h3poteto/iss-2244

refs #2244 Build universal package for MAS build using electron/universal
This commit is contained in:
AkiraFukushima 2021-03-18 01:17:16 +09:00 committed by GitHub
commit 226f4e1df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# Name of your app.
APP="Whalebird"
# The path of your app to sign.
APP_PATH="./packages/Whalebird-mas-x64/Whalebird.app"
APP_PATH="./packages/Whalebird-mas-universal/Whalebird.app"
# The path to the location you want to put the signed package.
RESULT_PATH="./packages/$APP.pkg"
# The name of certificates you requested.

View File

@ -31,7 +31,7 @@
"build:linux": "yarn run build && yarn run package:linux",
"build:win32": "yarn run build && yarn run package:win32",
"build:win64": "yarn run build && yarn run package:win64",
"build:mas": "yarn run build:clean && yarn run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=11.2.3 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
"build:mas": "yarn run build:clean && yarn run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --arch=arm64 --electron-version=11.2.3 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --app-category-type=public.app-category.social-networking && node ./packages/universal.js",
"package:mac": "electron-builder --mac",
"package:linux": "electron-builder --linux",
"package:win32": "electron-builder --win --ia32",
@ -217,6 +217,7 @@
"@babel/plugin-transform-runtime": "^7.12.15",
"@babel/preset-env": "^7.12.16",
"@babel/runtime": "7.12.13",
"@electron/universal": "^1.0.4",
"@mapbox/stylelint-processor-arbitrary-tags": "^0.3.0",
"@types/auto-launch": "^5.0.1",
"@types/electron-json-storage": "^4.0.0",

14
packages/universal.js Normal file
View File

@ -0,0 +1,14 @@
const { makeUniversalApp } = require('@electron/universal')
const path = require('path')
const x64AppPath = path.resolve(__dirname, './Whalebird-mas-x64/Whalebird.app')
const arm64AppPath = path.resolve(__dirname, './Whalebird-mas-arm64/Whalebird.app')
const universalAppPath = path.resolve(__dirname, './Whalebird-mas-universal/Whalebird.app')
;(async () => {
await makeUniversalApp({
x64AppPath: x64AppPath,
arm64AppPath: arm64AppPath,
outAppPath: universalAppPath
})
})()

View File

@ -881,7 +881,7 @@
global-agent "^2.0.2"
global-tunnel-ng "^2.7.1"
"@electron/universal@1.0.4":
"@electron/universal@1.0.4", "@electron/universal@^1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.0.4.tgz#231ac246c39d45b80e159bd21c3f9027dcaa10f5"
integrity sha512-ajZoumi4XwqwmZe8YVhu4XGkZBCPyWZsVCQONPTIe9TUlleSN+dic3YpXlaWcilx/HOzTdldTKtabNTeI0gDoA==