Skip to content

Commit

Permalink
build: Notarize the app
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Dec 2, 2019
1 parent c5a2464 commit 5396cae
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ os:
- linux
- osx
dist: trusty
osx_image: xcode8.3
osx_image: xcode10
sudo: false

cache:
Expand Down
12 changes: 9 additions & 3 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const package = require('./package.json');

module.exports = {
hooks: {
generateAssets: require('./tools/generateAssets')
generateAssets: require('./tools/generateAssets'),
postPackage: require('./tools/notarize')
},
packagerConfig: {
asar: false,
Expand All @@ -12,10 +13,15 @@ module.exports = {
appCategoryType: 'public.app-category.developer-tools',
win32metadata: {
CompanyName: 'Felix Rieseberg',
OriginalFilename: 'windows95',
OriginalFilename: 'windows95'
},
osxSign: {
identity: 'Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)'
identity: 'Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)',
'hardened-runtime': true,
'gatekeeper-assess': false,
'entitlements': 'static/entitlements.plist',
'entitlements-inherit': 'static/entitlements.plist',
'signature-flags': 'library'
},
ignore: [
/\/assets(\/?)/,
Expand Down
45 changes: 41 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"electron": "7.1.2",
"electron-notarize": "^0.2.1",
"less": "^3.10.3",
"node-abi": "^2.13.0",
"parcel-bundler": "^1.12.4",
Expand Down
10 changes: 10 additions & 0 deletions static/entitlements.plist
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>
29 changes: 29 additions & 0 deletions tools/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { notarize } = require('electron-notarize');
const path = require('path');

const buildOutput = path.resolve(
__dirname,
'..',
'out',
'windows95-darwin-x64',
'windows95.app'
);

module.exports = function () {
if (process.platform !== 'darwin') {
console.log('Not a Mac; skipping notarization');
return;
}

console.log('Notarizing...');

return notarize({
appBundleId: 'com.felixrieseberg.windows95',
appPath: buildOutput,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD
}).catch((e) => {
console.error(e);
throw e;
});
}

0 comments on commit 5396cae

Please sign in to comment.