OpenBuilds-CONTROL/signWin.js

25 wiersze
816 B
JavaScript
Czysty Zwykły widok Historia

2024-04-08 19:19:45 +00:00
const {
execSync
} = require('node:child_process')
2024-04-08 20:21:58 +00:00
console.info(`signing with SignWin`)
2024-04-08 19:19:45 +00:00
exports.default = async configuration => {
if (!process.env.SM_API_KEY) {
console.info(`Skip signing because SM_API_KEY and not configured`)
return
}
if (!configuration.path) {
throw new Error(`Path of application is not found`)
}
2024-04-08 20:21:58 +00:00
//signtool.exe sign /sha1 ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 "D:\a\OpenBuilds-CONTROL\OpenBuilds-CONTROL\dist\*.exe"
//signtool.exe verify /v /pa "D:\a\OpenBuilds-CONTROL\OpenBuilds-CONTROL\dist\*.exe"
execSync(`smctl sign --fingerprint="${process.env.SM_CODE_SIGNING_CERT_SHA1_HASH}" --input "${String(configuration.path)}"`, {
2024-04-08 19:19:45 +00:00
stdio: 'inherit',
})
2024-04-08 19:49:46 +00:00
console.info(`signed with SignWin`)
2024-04-08 19:19:45 +00:00
}