diff --git a/.gitignore b/.gitignore index c1020df2ab0..bd0362a7850 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store .DS_Store? dist/* +out/* node_modules/* third_party/* package-lock.json diff --git a/package.json b/package.json index 61118f6743d..e3c3c8b686e 100755 --- a/package.json +++ b/package.json @@ -36,6 +36,11 @@ "electron": "28.1.1", "electron-builder": "24.9.1", "@electron/notarize": "2.2.0", + "@electron-forge/cli": "7.2.0", + "@electron-forge/core": "7.2.0", + "@electron-forge/maker-snap": "7.2.0", + "@electron-forge/maker-dmg": "7.2.0", + "@electron-forge/maker-zip": "7.2.0", "eslint": "8.56.0" }, "eslintConfig": { @@ -103,6 +108,9 @@ "report-dir": "dist/nyc/coverage", "temp-dir": "dist/nyc/.nyc_output" }, + "config": { + "forge": "publish/forge.config.js" + }, "build": { "appId": "com.lutzroeder.netron", "productName": "Netron", diff --git a/publish/forge.config.js b/publish/forge.config.js new file mode 100644 index 00000000000..15b2623f463 --- /dev/null +++ b/publish/forge.config.js @@ -0,0 +1,65 @@ + +/* +const APPLE_API_KEY_ID = process.env.APPLE_API_KEY_ID; +const APPLE_API_KEY_ISSUER_ID = process.env.APPLE_API_KEY_ISSUER_ID; +*/ + +export default { + outDir: 'dist', + packagerConfig: { + icon: "publish/icon", + dir: [ + 'source' + ], + ignore: [ + "publish", + "third_party", + "test", + "tools" + ], + /* + osxNotarize: { + tool: 'notarytool', + appleApiKey: `~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8`, + appleApiKeyId: APPLE_API_KEY_ID, + appleApiIssuer: APPLE_API_KEY_ISSUER_ID + }, + */ + asar: true + }, + /* + makeTargets: { + win32: ['nsis'], + darwin: ['dmg', 'zip'], + linux: ['snap'], + }, + */ + makers: [ + { + name: '@electron-forge/maker-zip', + config: { + platforms: [ 'darwin' ], + // name: "${name}-${version}-mac.zip" + } + }, + { + name: '@electron-forge/maker-dmg', + config: { + background: './publish/background.png', + /* eslint-disable no-template-curly-in-string */ + name: "Netron-${version}" + /* eslint-enable no-template-curly-in-string */ + } + } + ], + publishers: [ + { + "name": "@electron-forge/publisher-github", + "config": {} + }, + { + "name": "@electron-forge/publisher-snapcraft", + "config": {} + } + ] +};