-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds scripts that run electron-notarize as additional manual or build steps on darvin runtime, loosly following https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ Context: #1211 License: MIT Signed-off-by: Marcin Rataj <[email protected]>
- Loading branch information
Showing
8 changed files
with
83 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
out | ||
dist | ||
.cache | ||
.env | ||
config.gypi | ||
assets/webui | ||
*.nupkg | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.cs.allow-jit</key> | ||
<true/> | ||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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,22 @@ | ||
require('dotenv').config() | ||
const { notarize } = require('electron-notarize') | ||
|
||
// electron-build hook to be used in electron-build pipeline in the future | ||
// =========================================================================== | ||
// Note: for now we don't use this at the moment. | ||
// Run ./notarize-cli.js instead | ||
exports.default = async function notarizing (context) { | ||
const { electronPlatformName, appOutDir } = context | ||
if (electronPlatformName !== 'darwin') return | ||
// skip notarization if secrets are not present in env | ||
if (!process.env.APPLEID || !process.env.APPLEIDPASS) return | ||
|
||
const appName = context.packager.appInfo.productFilename | ||
|
||
return notarize({ | ||
appBundleId: 'io.ipfs.desktop', | ||
appPath: `${appOutDir}/${appName}.app`, | ||
appleId: process.env.APPLEID, | ||
appleIdPassword: process.env.APPLEIDPASS | ||
}) | ||
} |
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,28 @@ | ||
require('dotenv').config() | ||
const { notarize } = require('electron-notarize') | ||
|
||
// Manual online notarization (no stapling) via CLI | ||
// ================================================ | ||
// Note: this assumes APPLEID and APPLEIDPASS to be | ||
// set as env variables or set in .env file | ||
// | ||
// Usage: | ||
// 1. Define APPLEID and APPLEIDPASS | ||
// 2. node ./notarize.js path/to/IPFS-Desktop.dmg | ||
;(async () => { | ||
const artifactPath = process.argv[2] | ||
if (!artifactPath) { | ||
console.log('Missing artifact path: pass it as CLI argument') | ||
process.exit(1) | ||
} | ||
if (!process.env.APPLEID || !process.env.APPLEIDPASS) { | ||
console.log('Define APPLEID and APPLEIDPASS as env variables or in .env file') | ||
process.exit(1) | ||
} | ||
await notarize({ | ||
appBundleId: 'io.ipfs.desktop', | ||
appPath: artifactPath, | ||
appleId: process.env.APPLEID, | ||
appleIdPassword: process.env.APPLEIDPASS | ||
}) | ||
})() |