-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## `cherry-pick` 246efcb Must update `chore_release-7.4.0` so that windows builds work and we may test an update. To understand the changes see #15718 Co-authored-by: Seth Foster <[email protected]>
- Loading branch information
Showing
3 changed files
with
134 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// from https://github.com/electron-userland/electron-builder/issues/7605 | ||
|
||
'use strict' | ||
|
||
const { execSync } = require('node:child_process') | ||
|
||
exports.default = async configuration => { | ||
const signCmd = `smctl sign --keypair-alias="${String( | ||
process.env.SM_KEYPAIR_ALIAS | ||
)}" --input "${String(configuration.path)}" --certificate="${String( | ||
process.env.WINDOWS_CSC_FILEPATH | ||
)}" --exit-non-zero-on-fail --failfast --verbose` | ||
console.log(signCmd) | ||
try { | ||
const signProcess = execSync(signCmd, { | ||
stdio: 'pipe', | ||
}) | ||
console.log(`Sign success!`) | ||
console.log( | ||
`Sign stdout: ${signProcess?.stdout?.toString() ?? '<no output>'}` | ||
) | ||
console.log( | ||
`Sign stderr: ${signProcess?.stderr?.toString() ?? '<no output>'}` | ||
) | ||
console.log(`Sign code: ${signProcess.code}`) | ||
} catch (err) { | ||
console.error(`Exception running sign: ${err.status}! | ||
Process stdout: | ||
${err?.stdout?.toString() ?? '<no output>'} | ||
------------- | ||
Process stderr: | ||
${err?.stdout?.toString() ?? '<no output>'} | ||
------------- | ||
`) | ||
throw err | ||
} | ||
const verifyCmd = `smctl sign verify --fingerprint="${String( | ||
process.env.SM_CODE_SIGNING_CERT_SHA1_HASH | ||
)}" --input="${String(configuration.path)}" --verbose` | ||
console.log(verifyCmd) | ||
try { | ||
const verifyProcess = execSync(verifyCmd, { stdio: 'pipe' }) | ||
console.log(`Verify success!`) | ||
console.log( | ||
`Verify stdout: ${verifyProcess?.stdout?.toString() ?? '<no output>'}` | ||
) | ||
console.log( | ||
`Verify stderr: ${verifyProcess?.stderr?.toString() ?? '<no output>'}` | ||
) | ||
} catch (err) { | ||
console.error(` | ||
Exception running verification: ${err.status}! | ||
Process stdout: | ||
${err?.stdout?.toString() ?? '<no output>'} | ||
-------------- | ||
Process stderr: | ||
${err?.stderr?.toString() ?? '<no output>'} | ||
-------------- | ||
`) | ||
throw err | ||
} | ||
} |