Reputation: 6372
I am using electron forge for building and packaging my electron app.
How can I code sign my app (using electron forge) for windows and mac?
Electrong-forge: https://github.com/electron-userland/electron-forge
Upvotes: 13
Views: 5938
Reputation: 8979
Only signing the electron app won't let the app work in production, as GateKeeper will not allow the app to open. You need to sign the application and then perform notarization. Here is how you can do that with electron forge.
"packagerConfig": {
"icon": "./resources/icon",
"osxSign": {
"identity": "Developer ID Application: Kiran Maniya (R8A8NS532)"
},
"osxNotarize": {
"tool": "notarytool",
"appleApiKey": "./signing/AuthKey_R8A8NS532.p8",
"appleApiKeyId": "R8A8NS532",
"appleApiIssuer": "30651f9c-0046-4d6a-aba3-db72ff6c32ef"
}
},
You can retrieve the identity name by running the command given below. Remember, The Developer ID Installer certificate is for apps distributed to the Mac App Store and Developer ID Application certificate is for apps distributed outside the Mac App Store.
security find-identity -p codesigning -v
Upvotes: 0
Reputation: 47471
EDIT: see https://stackoverflow.com/a/58665415/2165342 bellow. electronPackagerConfig is now packagerConfig
packagerConfig
key in your package.json
.Electron Forge uses Electron Packager under the hood and allows you to set the Electron Packager configuration in your package.json
.
Here's an extract of what mine looks like in order to sign our packaged application file:
package.json
{
"config": {
"forge": {
"packagerConfig": {
"osxSign": {
"identity": "Developer ID Application: Joshua Pinter (<your_key_code>)"
}
}
}
}
}
You can see that all the Electron Packager configurations can be put under the packagerConfig
key.
NOTE: In older versions of Electron Forge, this was called electronPackagerConfig
instead of packagerConfig
.
Upvotes: 9
Reputation: 7076
electronPackagerConfig
is now packagerConfig
, e.g.:
{
"config": {
"forge": {
"packagerConfig": {
"osxSign": {
"identity": "Developer ID Application: Company (id)"
}
}
}
}
}
Upvotes: 2