Skip to content

Commit

Permalink
Add custom build configuration (electron builder)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAstafyev committed May 8, 2024
1 parent 2045884 commit 5f6441e
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 63 deletions.
45 changes: 45 additions & 0 deletions application/holder/electron.config.darwin.arm64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"asar": true,
"appId": "com.esrlabs.chipmunk",
"productName": "chipmunk",
"copyright": "Copyright © 2022 year ESR Labs",
"files": [
"./dist/**",
"./resources/**"
],
"extraFiles": [
{
"from": "../apps/precompiled/updater/target/release",
"to": "Resources/bin",
"filter": [
"updater",
"updater.exe"
]
}
],
"directories": {
"output": "release",
"buildResources": "resources"
},
"asarUnpack": [
"resources"
],
"npmRebuild": true,
"afterSign": "hooks/afterSign.js",
"mac": {
"category": "public.app-category.developer-tools",
"icon": "resources/mac/chipmunk.icns",
"target": [],
"binaries": [
"./release/mac-arm64/chipmunk.app/Contents/Resources/bin/updater"
],
"extendInfo": {
"NSCameraUsageDescription": "",
"NSMicrophoneUsageDescription": ""
},
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "./resources/mac/entitlements.mac.plist",
"entitlementsInherit": "./resources/mac/entitlements.mac.plist"
}
}
45 changes: 45 additions & 0 deletions application/holder/electron.config.darwin.x86.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"asar": true,
"appId": "com.esrlabs.chipmunk",
"productName": "chipmunk",
"copyright": "Copyright © 2022 year ESR Labs",
"files": [
"./dist/**",
"./resources/**"
],
"extraFiles": [
{
"from": "../apps/precompiled/updater/target/release",
"to": "Resources/bin",
"filter": [
"updater",
"updater.exe"
]
}
],
"directories": {
"output": "release",
"buildResources": "resources"
},
"asarUnpack": [
"resources"
],
"npmRebuild": true,
"afterSign": "hooks/afterSign.js",
"mac": {
"category": "public.app-category.developer-tools",
"icon": "resources/mac/chipmunk.icns",
"target": [],
"binaries": [
"./release/mac/chipmunk.app/Contents/Resources/bin/updater"
],
"extendInfo": {
"NSCameraUsageDescription": "",
"NSMicrophoneUsageDescription": ""
},
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "./resources/mac/entitlements.mac.plist",
"entitlementsInherit": "./resources/mac/entitlements.mac.plist"
}
}
35 changes: 35 additions & 0 deletions application/holder/electron.config.linux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"asar": true,
"appId": "com.esrlabs.chipmunk",
"productName": "chipmunk",
"copyright": "Copyright © 2022 year ESR Labs",
"files": [
"./dist/**",
"./resources/**"
],
"extraFiles": [
{
"from": "../apps/precompiled/updater/target/release",
"to": "Resources/bin",
"filter": [
"updater",
"updater.exe"
]
}
],
"directories": {
"output": "release",
"buildResources": "resources"
},
"asarUnpack": [
"resources"
],
"npmRebuild": true,
"afterSign": "hooks/afterSign.js",
"linux": {
"icon": "resources/icons/png/256.png",
"executableName": "chipmunk",
"desktop": "resources/linux/chipmunk.desktop",
"target": []
}
}
34 changes: 34 additions & 0 deletions application/holder/electron.config.win.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"asar": true,
"appId": "com.esrlabs.chipmunk",
"productName": "chipmunk",
"copyright": "Copyright © 2022 year ESR Labs",
"files": [
"./dist/**",
"./resources/**"
],
"extraFiles": [
{
"from": "../apps/precompiled/updater/target/release",
"to": "Resources/bin",
"filter": [
"updater",
"updater.exe"
]
}
],
"directories": {
"output": "release",
"buildResources": "resources"
},
"asarUnpack": [
"resources"
],
"npmRebuild": true,
"afterSign": "hooks/afterSign.js",
"win": {
"icon": "resources/win/chipmunk.ico",
"target": [],
"publisherName": "ESR Labs"
}
}
63 changes: 4 additions & 59 deletions application/holder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,62 +23,6 @@
],
"main": "./dist/app.js",
"copyright": "Copyright © 2023 year ESR Labs",
"build": {
"asar": true,
"appId": "com.esrlabs.chipmunk",
"productName": "chipmunk",
"copyright": "Copyright © 2022 year ESR Labs",
"files": [
"./dist/**",
"./resources/**"
],
"extraFiles": [
{
"from": "../apps/precompiled/updater/target/release",
"to": "Resources/bin",
"filter": [
"updater",
"updater.exe"
]
}
],
"directories": {
"output": "release",
"buildResources": "resources"
},
"asarUnpack": [
"resources"
],
"npmRebuild": true,
"afterSign": "hooks/afterSign.js",
"mac": {
"category": "public.app-category.developer-tools",
"icon": "resources/mac/chipmunk.icns",
"target": [],
"binaries": [
"./release/mac/chipmunk.app/Contents/Resources/bin/updater"
],
"extendInfo": {
"NSCameraUsageDescription": "",
"NSMicrophoneUsageDescription": ""
},
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "./resources/mac/entitlements.mac.plist",
"entitlementsInherit": "./resources/mac/entitlements.mac.plist"
},
"linux": {
"icon": "resources/icons/png/256.png",
"executableName": "chipmunk",
"desktop": "resources/linux/chipmunk.desktop",
"target": []
},
"win": {
"icon": "resources/win/chipmunk.ico",
"target": [],
"publisherName": "ESR Labs"
}
},
"dependencies": {
"commander": "^12.0.0",
"glob": "9.3.5",
Expand Down Expand Up @@ -118,9 +62,10 @@
"build": "node_modules/.bin/tsc -p tsconfig.json",
"start": "npm run build-ts && npm run electron",
"postinstall": "electron-builder install-app-deps",
"build-darwin": "node_modules/.bin/electron-builder --mac --dir",
"build-linux": "node_modules/.bin/electron-builder --linux --dir",
"build-win": "node_modules/.bin/electron-builder --win --dir",
"build-darwin-arm64": "node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.arm64.json",
"build-darwin-x86": "node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.x86.json",
"build-linux": "node_modules/.bin/electron-builder --linux --dir --config=./electron.config.linux.json",
"build-win": "node_modules/.bin/electron-builder --win --dir --config=./electron.config.win.json",
"lint": "node_modules/.bin/eslint . --ext .ts --max-warnings=0",
"check": "node_modules/.bin/tsc -p tsconfig.json --noemit"
}
Expand Down
16 changes: 12 additions & 4 deletions scripts/elements/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ def self.build_cmd
Release.load_from_env
if OS.mac?
if ENV.key?('APPLEID') && ENV.key?('APPLEIDPASS') && !ENV.key?('SKIP_NOTARIZE')
'./node_modules/.bin/electron-builder --mac --dir'
if OS.arm64?
'./node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.arm64.json'
else
'./node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.x86.json'
end
else
'./node_modules/.bin/electron-builder --mac --dir -c.mac.identity=null'
if OS.arm64?
'./node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.arm64.json -c.mac.identity=null'
else
'./node_modules/.bin/electron-builder --mac --dir --config=./electron.config.darwin.x86.json -c.mac.identity=null'
end
end
elsif OS.linux?
'./node_modules/.bin/electron-builder --linux --dir'
'./node_modules/.bin/electron-builder --linux --dir --config=./electron.config.linux.json'
else
'./node_modules/.bin/electron-builder --win --dir'
'./node_modules/.bin/electron-builder --win --dir --config=./electron.config.win.json'
end
end

Expand Down

0 comments on commit 5f6441e

Please sign in to comment.