forked from wexond/browser-base
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelectron-builder.widevine.js
38 lines (33 loc) · 1.04 KB
/
electron-builder.widevine.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
/* eslint-disable */
const common = require('./electron-builder.common')
const { exec } = require('child_process')
function signIf(targetPlatform) {
return ({ appOutDir, electronPlatformName }) => {
if (electronPlatformName !== targetPlatform) {
return
}
return new Promise((resolve, reject) => {
exec(`${process.env.PYTHON3 ?? 'python3'} -m castlabs_evs.vmp sign-pkg ${appOutDir}`, (err) => {
if (err) {
return reject(err)
}
resolve()
})
})
}
}
module.exports = async function() {
const { default: getElectronVersion } = await import('./script/electron-version.mjs')
const ELECTRON_VERSION = await getElectronVersion()
return {
...common,
artifactName: '${productName}-${version}-${os}-${arch}-widevine.${ext}',
afterPack: signIf('darwin'),
afterSign: signIf('win32'),
electronVersion: ELECTRON_VERSION,
electronDownload: {
version: `${ELECTRON_VERSION}+wvcus`,
mirror: 'https://github.com/castlabs/electron-releases/releases/download/v'
}
}
}