-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
electron-builder-publish.js
129 lines (124 loc) · 2.56 KB
/
electron-builder-publish.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
const config = {
publish: [
'github'
],
productName: 'Tidepool Uploader',
appId: 'org.tidepool.TidepoolUploader',
directories: {
buildResources: 'resources',
output: 'release'
},
afterSign: 'scripts/notarize.js',
dmg: {
contents: [
{
x: 381,
y: 190,
type: 'link',
path: '/Applications'
},
{
x: 159,
y: 190,
type: 'file'
}
],
background: 'resources/background.tiff'
},
nsis: {
oneClick: false,
perMachine: true,
allowElevation: true
},
files: [
'dist/',
'node_modules/',
'app.html',
'main.prod.js',
'main.prod.js.map',
'package.json'
],
extraResources: [
{
from: 'resources/${os}',
to: 'driver/',
filter: [
'**/*',
'!*.md'
]
},
'sounds/',
'locales/'
],
win: {
target: [
{
target: 'nsis',
arch: [
'ia32',
'x64'
]
},
{
target: 'zip',
arch: [
'ia32',
'x64'
]
}
],
publisherName: [
'Tidepool Project'
],
rfc3161TimeStampServer: 'http://timestamp.digicert.com',
asarUnpack: '**\\*.node',
},
mac: {
category: 'public.app-category.tools',
target: [
{
target: 'zip',
arch: [
'x64'
]
},
{
target: 'dmg',
arch: [
'x64'
]
},
'dir'
],
notarize: false,
asarUnpack: 'app/node_modules/keytar', // https://github.com/electron-userland/electron-builder/issues/3940#issuecomment-900527250
},
protocols: [{
name: 'Tidepool Uploader',
schemes: ['tidepooluploader', 'tidepoolupload'],
}],
};
console.log('CIRCLE_TAG:', process.env.CIRCLE_TAG);
console.log('APPVEYOR_REPO_TAG:', process.env.APPVEYOR_REPO_TAG);
if ( (process.env.CIRCLE_TAG && process.env.CIRCLE_TAG.length > 0) ||
(process.env.APPVEYOR_REPO_TAG_NAME && process.env.APPVEYOR_REPO_TAG_NAME.length > 0) ) {
let releaseType = null;
if ( (process.env.CIRCLE_TAG && process.env.CIRCLE_TAG.indexOf('-') !== -1) ||
(process.env.APPVEYOR_REPO_TAG_NAME && process.env.APPVEYOR_REPO_TAG_NAME.indexOf('-') !== -1) ) {
releaseType = 'prerelease';
} else {
releaseType = 'release';
}
config.publish = [
{
provider: 'github',
owner: 'tidepool-org', // required to overwrite existing binaries
releaseType: releaseType,
},
{
provider: 's3',
bucket: 'downloads.tidepool.org',
},
];
}
module.exports = config;