-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy solution for signing Windows .exe from bcc-code/bible-explorers (…
…#419) * copy solution for signing Windows .exe from bcc-code/bible-explorers * (temporarily) enable signing on PR * add debug logs * fix checking for filename * escape file path * next try * remove debug logs * don't publish for PRs
- Loading branch information
Showing
4 changed files
with
45 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist-electron | ||
BMM.Web | ||
BMM.Web | ||
electron_sign_exe.js |
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,23 @@ | ||
const { execSync } = require("child_process"); | ||
|
||
module.exports = async function (configuration) { | ||
if (!configuration.path.includes(configuration.name + " Setup")) { | ||
return; | ||
} | ||
|
||
const filePath = configuration.path; | ||
const directoryId = process.env.WINDOWS_DIRECTORY_ID; | ||
const clientId = process.env.WINDOWS_CLIENT_ID; | ||
const clientSecret = process.env.WINDOWS_CLIENT_SECRET; | ||
|
||
try { | ||
execSync( | ||
`AzureSignTool.exe sign -du "https://bmm.bcc.media" -kvu "https://bccm-code-sign2.vault.azure.net" -kvt ${directoryId} -kvi ${clientId} -kvs ${clientSecret} -kvc "HSM-CS" -tr "http://timestamp.digicert.com" -v "${filePath}"`, | ||
{ stdio: "inherit" }, | ||
); | ||
console.log(`Successfully signed ${filePath}`); | ||
} catch (error) { | ||
console.error(`Failed to sign ${filePath}`); | ||
throw error; | ||
} | ||
}; |