-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelectron-builder.config.js
89 lines (82 loc) · 1.6 KB
/
electron-builder.config.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const fs = require('fs')
const dotenv = require('dotenv')
const envConfig = dotenv.parse(fs.readFileSync('.env'))
for (var k in envConfig) {
process.env[k] = envConfig[k]
}
/**
* PUBLISH CONFIG
* If it's minio:
* - we need to provide the endpoint. eg: http://192.168.0.100:9000
* If it's real S3
* - let electron-builder guess everything.
* Even if the endpoint is a valid S3 one, like: https://s3.eu-central-1.amazonaws.com
* electron-builder will fail to guess the correct region.
*/
const publish = {
provider: 's3',
bucket: process.env.S3_BUCKET,
}
if (process.env.DEPLOY_TO === 'minio') {
publish.endpoint = process.env.S3_ENDPOINT
}
const config = {
productName: 'Kaiku',
appId: 'com.kevinpurnelle.kaiku',
publish,
dmg: {
contents: [
{
x: 410,
y: 150,
type: 'link',
path: '/Applications'
},
{
x: 130,
y: 150,
type: 'file'
}
]
},
files: [
'dist/',
'images/',
'main/',
'node_modules/',
'package.json',
'!main.js',
],
mac: {
category: 'public.app-category.music',
target: [
'zip',
'dmg'
]
},
win: {
target: [
'nsis'
]
},
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true,
},
linux: {
target: [
'AppImage'
]
},
directories: {
buildResources: 'buildResources',
output: 'electronReleases'
}
}
function checkConfig (config) {
if (typeof config.publish.bucket !== 'string') {
throw new Error('config.publish.bucket invalid')
}
}
checkConfig(config)
module.exports = config