-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-win.js
56 lines (49 loc) · 1.38 KB
/
build-win.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* This script is used to build the electron app **with notarization**. It is used for the final build and release process.
*/
require('dotenv').config();
const build = require('electron-builder').build;
const { publishOptions } = require('./electron/constants');
function artifactName() {
const env = process.env.NODE_ENV;
const prefix = env === 'production' ? '' : 'dev-';
return prefix + '${productName}-${version}-${platform}-${arch}.${ext}';
}
const main = async () => {
console.log('Building...');
/** @type import {CliOptions} from "electron-builder" */
await build({
publish: 'onTag',
config: {
appId: 'xyz.valory.olas-operate-app',
artifactName: artifactName(),
productName: 'Pearl',
files: ['electron/**/*', 'package.json'],
directories: {
output: 'dist',
},
nsis: {
oneClick: false,
},
win: {
publish: publishOptions,
icon: 'electron/assets/icons/splash-robot-head-dock.png',
signtoolOptions: { sign: "./customSign.js", },
},
extraResources: [
{
from: 'electron/bins',
to: 'bins',
filter: ['**/*'],
},
{
from: '.env',
to: '.env'
},
],
},
});
};
main().then(() => {
console.log('Build & Notarize complete');
});