mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 23:22:05 +08:00
build: add win-sign script
This commit is contained in:
parent
75153ce83c
commit
fc5209723f
@ -45,6 +45,8 @@ win:
|
|||||||
target:
|
target:
|
||||||
- target: nsis
|
- target: nsis
|
||||||
- target: portable
|
- target: portable
|
||||||
|
signtoolOptions:
|
||||||
|
sign: scripts/win-sign.js
|
||||||
nsis:
|
nsis:
|
||||||
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
artifactName: ${productName}-${version}-${arch}-setup.${ext}
|
||||||
shortcutName: ${productName}
|
shortcutName: ${productName}
|
||||||
|
|||||||
19
scripts/win-sign.js
Normal file
19
scripts/win-sign.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const { execSync } = require('child_process')
|
||||||
|
|
||||||
|
exports.default = async function (configuration) {
|
||||||
|
if (process.env.WIN_SIGN) {
|
||||||
|
const { path } = configuration
|
||||||
|
if (configuration.path) {
|
||||||
|
try {
|
||||||
|
console.log('Start code signing...')
|
||||||
|
console.log('Signing file:', path)
|
||||||
|
const signCommand = `signtool sign /tr http://timestamp.comodoca.com /td sha256 /fd sha256 /a /v "${path}"`
|
||||||
|
execSync(signCommand, { stdio: 'inherit' })
|
||||||
|
console.log('Code signing completed')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Code signing failed:', error)
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user