-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ituob/itu-ob-editor
# Conflicts: # package.json
- Loading branch information
Showing
7 changed files
with
361 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esversion": 6 | ||
} |
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 @@ | ||
11.14.0 |
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,12 @@ | ||
<?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/> | ||
<key>com.apple.security.cs.allow-dyld-environment-variables</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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
{ | ||
"name": "itu-ob-editor", | ||
"version": "0.1.1", | ||
"description": "ITU OB data editor", | ||
"repository": "[email protected]:ituob/itu-ob-editor.git", | ||
"bugs": "https://github.com/ituob/itu-ob-editor/issues", | ||
"author": "Ribose Inc. <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "electron-webpack dev", | ||
"compile": "electron-webpack", | ||
"dist": "cross-env DEBUG=electron-builder electron-builder", | ||
"dist:win": "electron-builder -w", | ||
"dist:mac": "electron-builder -m", | ||
"pack": "electron-builder --dir", | ||
"release": "electron-builder --publish always", | ||
"cdist": "yarn compile && electron-builder -mlw", | ||
"cdist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null" | ||
}, | ||
|
@@ -21,9 +28,65 @@ | |
}, | ||
"build": { | ||
"productName": "ITU OB Editor", | ||
"appId": "org.ituob.editor", | ||
"afterSign": "./scripts/hooks/after-sign.js", | ||
"mac": { | ||
"target": "dmg" | ||
} | ||
"category": "public.app-category.productivity", | ||
"icon": "build/icon.icns", | ||
"target": "dmg", | ||
"gatekeeperAssess": false, | ||
"hardenedRuntime": true, | ||
"entitlements": "assets/mac/entitlements.mac.inherit.plist", | ||
"entitlementsInherit": "assets/mac/entitlements.mac.inherit.plist" | ||
}, | ||
"dmg": { | ||
"contents": [ | ||
{ | ||
"x": 110, | ||
"y": 150 | ||
}, | ||
{ | ||
"x": 440, | ||
"y": 150, | ||
"type": "link", | ||
"path": "/Applications" | ||
} | ||
], | ||
"artifactName": "itu-ob-editor-${version}.${ext}" | ||
}, | ||
"win": { | ||
"target": [ | ||
{ | ||
"target": "nsis", | ||
"arch": [ | ||
"x64" | ||
] | ||
}, | ||
{ | ||
"target": "portable" | ||
} | ||
], | ||
"icon": "build/icon.ico" | ||
}, | ||
"nsis": { | ||
"runAfterFinish": true, | ||
"installerIcon": "build/icon.ico", | ||
"artifactName": "electron-gha-${version}.${ext}" | ||
}, | ||
"portable": { | ||
"artifactName": "itu-ob-editor.exe" | ||
}, | ||
"appx": { | ||
"backgroundColor": "#464646", | ||
"publisherDisplayName": "ituob", | ||
"artifactName": "itu-ob-editor-${version}.${ext}" | ||
}, | ||
"publish": [ | ||
{ | ||
"provider": "github", | ||
"releaseType": "release" | ||
} | ||
] | ||
}, | ||
"dependencies": { | ||
"@aeaton/react-prosemirror": "https://github.com/riboseinc/react-prosemirror#aeaton-react-prosemirror-v0.22.10-gitpkg", | ||
|
@@ -62,12 +125,15 @@ | |
"@types/react-dom": "^16.9.4", | ||
"@types/react-transition-group": "^4.2.3", | ||
"@types/throttle-debounce": "^2.1.0", | ||
"cross-env": "^6.0.3", | ||
"electron": "^7.1.2", | ||
"electron-builder": "^21.2.0", | ||
"electron-notarize": "^0.2.1", | ||
"electron-react-devtools": "^0.5.3", | ||
"electron-webpack": "^2.7.4", | ||
"electron-webpack-ts": "^3.2.0", | ||
"node-sass": "^4.12.0", | ||
"npm-run-all": "^4.1.5", | ||
"sass-loader": "^7.1.0", | ||
"typescript": "^3.7.2", | ||
"webpack": "~4.35.2" | ||
|
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,49 @@ | ||
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
var electron_notarize = require('electron-notarize'); | ||
|
||
module.exports = async function notarize(params) { | ||
// Only notarize the app on macOS | ||
if (process.platform !== 'darwin') { | ||
return; | ||
} | ||
console.log('afterSign hook triggered', params); | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
return console.warn('Skipping notarization, NODE_ENV=development'); | ||
} | ||
|
||
// Use the same appId as specified in electron-builder configuration | ||
let appId = 'org.ituob.editor'; | ||
|
||
let appPath = path.join( | ||
params.appOutDir, | ||
`${params.packager.appInfo.productFilename}.app` | ||
); | ||
if (!fs.existsSync(appPath)) { | ||
throw new Error(`Cannot find application at: ${appPath}`); | ||
} | ||
|
||
console.log(`Notarizing ${appId} found at ${appPath}`); | ||
|
||
let appleId = process.env.AID | ||
if (!appleId) throw new Error('No Apple ID found ($AID variable)'); | ||
|
||
let appleIdPassword = process.env.AIP | ||
if (!appleIdPassword) throw new Error('No Apple ID password found ($AIP variable)'); | ||
|
||
try { | ||
await electron_notarize.notarize({ | ||
appBundleId: appId, | ||
appPath: appPath, | ||
appleId: appleId, | ||
appleIdPassword: appleIdPassword, | ||
}); | ||
} catch (error) { | ||
console.error(`Failed to notarize: ${err ? err.message : 'error message not specified'}`); | ||
} | ||
|
||
console.log(`Done notarizing ${appId}`); | ||
}; |
Oops, something went wrong.