Skip to content

Commit 739d976

Browse files
committed
works on mac
1 parent c9ca126 commit 739d976

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

build.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* This script is used to build the electron app **with notarization**. It is used for the final build and release process.
3+
*/
4+
require('dotenv').config();
15
const build = require('electron-builder').build;
26

37
const { publishOptions } = require('./electron/constants');

build.tester.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* This script is used to build the electron app **without** notarization.
3+
*
4+
* This is useful for testing the build process.
5+
* It will not notarize the app, so it will not be able to be run on someone else's Mac without disabling Gatekeeper on their machine.
6+
*/
7+
require('dotenv').config();
8+
const build = require('electron-builder').build;
9+
10+
const { publishOptions } = require('./electron/constants');
11+
12+
const main = async () => {
13+
console.log('Building...');
14+
15+
/** @type import {CliOptions} from "electron-builder" */
16+
await build({
17+
publish: 'onTag',
18+
config: {
19+
appId: 'xyz.valory.olas-operate-app',
20+
artifactName: '${productName}-${version}-${platform}-${arch}.${ext}',
21+
productName: 'Pearl',
22+
files: ['electron/**/*', 'package.json'],
23+
directories: {
24+
output: 'dist',
25+
},
26+
extraResources: [
27+
{
28+
from: 'electron/bins',
29+
to: 'bins',
30+
filter: ['**/*'],
31+
},
32+
],
33+
mac: {
34+
publish: null,
35+
target: [
36+
{
37+
target: 'default',
38+
arch: ['arm64'],
39+
},
40+
],
41+
category: 'public.app-category.utilities',
42+
icon: 'electron/assets/icons/splash-robot-head-dock.png',
43+
hardenedRuntime: true,
44+
gatekeeperAssess: false,
45+
entitlements: 'electron/entitlements.mac.plist',
46+
entitlementsInherit: 'electron/entitlements.mac.plist',
47+
},
48+
},
49+
});
50+
};
51+
52+
main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));

electron/constants/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const os = require('os');
22
const path = require('path');
3+
require('dotenv').config();
34

45
const PORT_RANGE = { startPort: 39152, endPort: 65535 };
56
const ERROR_ADDRESS_IN_USE = 'EADDRINUSE';
@@ -10,8 +11,8 @@ const isMac = process.platform === 'darwin';
1011
const isLinux = process.platform === 'linux';
1112

1213
// Environment specific constants
13-
const isProd = process.env.NODE_ENV === 'production';
14-
const isDev = !isProd;
14+
const isDev = process.env.NODE_ENV === 'development';
15+
const isProd = !isDev;
1516

1617
// Paths
1718
const dotOperateDirectory = isProd

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"productName": "Pearl",
4444
"description": "An all-in-one application designed to streamline your entry into the world of autonomous agents and earning OLAS through staking.",
4545
"scripts": {
46-
"build": "rm -rf dist/ && electron-builder build",
46+
"build": "rm -rf dist/ && node build.tester.js",
4747
"build:frontend": "cd frontend && yarn build && rm -rf ../electron/.next && cp -r .next ../electron/.next && rm -rf ../electron/public && cp -r public ../electron/public",
4848
"dev:backend": "poetry run python operate/cli.py",
4949
"dev:frontend": "cd frontend && yarn dev",

0 commit comments

Comments
 (0)