-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Update Windows signing Cert to eToken (#2452)
- Loading branch information
1 parent
aa9b10d
commit 2e78e96
Showing
4 changed files
with
117 additions
and
37 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
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,30 @@ | ||
const childProcess = require('child_process'); | ||
|
||
exports.default = async function (configuration) { | ||
if (!process.env.GITHUB_ACTIONS) { | ||
return; | ||
} | ||
|
||
const SIGNTOOL_PATH = process.env.SIGNTOOL_PATH; | ||
const INSTALLER_CERT_WINDOWS_CER = process.env.INSTALLER_CERT_WINDOWS_CER; | ||
const CERT_PASSWORD = process.env.WIN_CERT_PASSWORD; | ||
const CONTAINER_NAME = process.env.WIN_CERT_CONTAINER_NAME; | ||
const filePath = configuration.path; | ||
|
||
if ( | ||
SIGNTOOL_PATH && | ||
INSTALLER_CERT_WINDOWS_CER && | ||
CERT_PASSWORD && | ||
CONTAINER_NAME | ||
) { | ||
childProcess.execSync( | ||
`"${SIGNTOOL_PATH}" sign -d "Arduino IDE" -f "${INSTALLER_CERT_WINDOWS_CER}" -csp "eToken Base Cryptographic Provider" -k "[{{${CERT_PASSWORD}}}]=${CONTAINER_NAME}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${filePath}"`, | ||
{ stdio: 'inherit' } | ||
); | ||
} else { | ||
console.warn( | ||
`Custom windows signing was no performed one of the following variables was not provided: SIGNTOOL_PATH (${SIGNTOOL_PATH}), INSTALLER_CERT_WINDOWS_CERT (${INSTALLER_CERT_WINDOWS_CER}), CERT_PASSWORD (${CERT_PASSWORD}), CONTAINER_NAME (${CONTAINER_NAME})` | ||
); | ||
process.exit(1); | ||
} | ||
}; |