Skip to content

Commit

Permalink
Merge pull request #4180 from h3poteto/fix/darwin-build
Browse files Browse the repository at this point in the history
Fix darwin build
  • Loading branch information
h3poteto authored Mar 8, 2023
2 parents 9757ea8 + de28fe9 commit b6c62e1
Show file tree
Hide file tree
Showing 10 changed files with 345 additions and 485 deletions.
4 changes: 2 additions & 2 deletions .electron-vue/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if (process.env.BUILD_TARGET === 'clean') clean()
else build()

function clean() {
del.sync(['build/*', '!build/icons', '!build/icons/icon.*', '!build/sounds', '!build/sounds/*', '!build/notarize.js'])
del.sync(['packages/*', '!packages/universal.js'])
del.sync(['build/*', '!build/icons', '!build/icons/icon.*', '!build/sounds', '!build/sounds/*'])
del.sync(['packages/*'])
console.log(`\n${doneLog}\n`)
process.exit()
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
release-darwin:
name: Release for MacOS

runs-on: macos-11
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -116,7 +116,7 @@ jobs:
env:
VERSION: ${{ github.event.release.name }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
ASC_PROVIDER: ${{ secrets.ASC_PROVIDER }}
TEAM_ID: ${{ secrets.ASC_PROVIDER }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mac:

mas:
yarn run build:clean
yarn run build:mas
yarn run package:mas
./appStore.sh

linux:
Expand Down
3 changes: 3 additions & 0 deletions appStore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP H
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper"
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/Resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-x64/node_sqlite3.node"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/Resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v{napi_build_version}-darwin-unknown-x64/node_sqlite3.node"
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/Resources/app.asar.unpacked/node_modules/sqlite3/lib/binding/napi-v{napi_build_version}-darwin-unknown-arm64/node_sqlite3.node"
codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH"

productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"
20 changes: 0 additions & 20 deletions build/notarize.js

This file was deleted.

22 changes: 7 additions & 15 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"productName": "Whalebird",
"appId": "social.whalebird.app",
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"buildVersion": "152",
"directories": {
"output": "build"
},
Expand All @@ -12,9 +11,9 @@
],
"files": [
"dist/electron/**/*",
"build/icons/*"
"build/icons/*",
"!node_modules/**/*.{mk,a,o,h,forge-meta}"
],
"afterSign": "build/notarize.js",
"dmg": {
"sign": false,
"contents": [
Expand All @@ -31,16 +30,6 @@
}
]
},
"mas": {
"type": "distribution",
"entitlements": "plist/parent.plist",
"entitlementsInherit": "plist/child.plist",
"entitlementsLoginHelper": "plist/loginhelper.plist",
"hardenedRuntime": false,
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
}
},
"mac": {
"icon": "build/icons/icon.icns",
"target": [
Expand All @@ -60,10 +49,13 @@
"hardenedRuntime": true,
"gatekeeperAssess": false,
"darkModeSupport": true,
"singleArchFiles": "*/binding/napi-v6-darwin-unknown-*",
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
}
},
"notarize": {
"teamId": "HB4N6B2YVM"
},
"singleArchFiles": "*"
},
"win": {
"icon": "build/icons/icon.ico",
Expand Down
49 changes: 49 additions & 0 deletions electron-builder.mas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"productName": "Whalebird",
"appId": "social.whalebird.app",
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"buildVersion": "154",
"directories": {
"output": "build"
},
"extraResources": [
"build/sounds/*",
"build/icons/*"
],
"files": [
"dist/electron/**/*",
"build/icons/*",
"!node_modules/**/*.{mk,a,o,h,forge-meta}"
],
"mas": {
"type": "distribution",
"entitlements": "plist/parent.plist",
"entitlementsInherit": "plist/child.plist",
"entitlementsLoginHelper": "plist/loginhelper.plist",
"hardenedRuntime": false,
"gatekeeperAssess": false,
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
}
},
"mac": {
"icon": "build/icons/icon.icns",
"target": [
{
"target": "mas",
"arch": [
"universal"
]
}
],
"category": "public.app-category.social-networking",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"darkModeSupport": true,
"extendInfo": {
"ITSAppUsesNonExemptEncryption": "false"
},
"notarize": false,
"singleArchFiles": "*"
}
}
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"build": "node .electron-vue/build.js",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"build:mas": "electron-builder --mac mas --universal --config electron-builder.json",
"package:mas": "electron-builder --mac --publish never --config electron-builder.mas.json",
"package:mac": "electron-builder --mac --publish never --config electron-builder.json",
"package:linux": "electron-builder --linux --publish never --config electron-builder.json",
"package:win32": "electron-builder --win --ia32 --publish never --config electron-builder.json",
"package:win64": "electron-builder --win --x64 --publish never --config electron-builder.json",
"package:pacman": "electron-builder --linux pacman --publish never --config electron-builder.json",
"package:appx2": "electron-builder --win --x64 --config electron-builder.json && electron-windows-store --assets .\\build\\icons --input-directory .\\build\\win-unpacked --output-directory .\\build\\appx --package-name Whalebird --package-display-name Whalebird --package-version 5.0.1.0 --publisher-display-name h3poteto --identity-name 45610h3poteto.Whalebird",
"package:appx2": "electron-builder --win --x64 --config electron-builder.json && electron-windows-store --assets .\\build\\icons --input-directory .\\build\\win-unpacked --output-directory .\\build\\appx --package-name Whalebird --package-display-name Whalebird --package-version 5.0.1.1 --publisher-display-name h3poteto --identity-name 45610h3poteto.Whalebird",
"pack": "yarn run pack:main && yarn run pack:renderer",
"pack:main": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.main.config.js",
"pack:renderer": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.renderer.config.js",
Expand Down Expand Up @@ -120,7 +120,6 @@
"@babel/preset-env": "^7.20.2",
"@babel/register": "^7.21.0",
"@babel/runtime": "7.21.0",
"@electron/universal": "^1.3.4",
"@types/auto-launch": "^5.0.2",
"@types/electron-json-storage": "^4.5.0",
"@types/jest": "27.4.1",
Expand Down Expand Up @@ -150,12 +149,10 @@
"del": "^6.1.1",
"devtron": "^1.4.0",
"electron": "20.3.12",
"electron-builder": "23.6.0",
"electron-builder": "24.0.0",
"electron-debug": "^3.2.0",
"electron-devtools-installer": "^3.2.0",
"electron-mock-ipc": "^0.3.12",
"electron-notarize": "^1.2.2",
"electron-packager": "^17.1.1",
"electron-windows-store": "^2.1.0",
"eslint": "^8.35.0",
"eslint-plugin-vue": "^9.9.0",
Expand Down
14 changes: 0 additions & 14 deletions packages/universal.js

This file was deleted.

Loading

0 comments on commit b6c62e1

Please sign in to comment.