mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-21 14:47:46 -04:00
use electron-build notarize config (#5635)
* use electron-build notarize config * update electron-builder.config * Re-add snapcraft fix done in #5555 * update electron-builder Co-authored-by: Filipe Freire <livrofubia@gmail.com>
This commit is contained in:
2
.github/workflows/release-build.yml
vendored
2
.github/workflows/release-build.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: '--max_old_space_size=6144'
|
||||
APPLE_ID: ${{ matrix.os == 'macos-latest' && secrets.DESIGNER_APPLE_ID || '' }}
|
||||
APPLE_ID_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.DESIGNER_APPLE_ID_PASSWORD || '' }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.DESIGNER_APPLE_ID_PASSWORD || '' }}
|
||||
CSC_LINK: ${{ matrix.csc_link_secret != '' && secrets[matrix.csc_link_secret] || '' }}
|
||||
CSC_KEY_PASSWORD: ${{ matrix.csc_key_password_secret != '' && secrets[matrix.csc_key_password_secret] || '' }}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ const BINARY_PREFIX = 'Insomnia.Core';
|
||||
* @see https://www.electron.build/configuration/configuration
|
||||
*/
|
||||
const config = {
|
||||
npmRebuild: false,
|
||||
appId: 'com.insomnia.app',
|
||||
protocols: [
|
||||
{
|
||||
@@ -25,7 +26,6 @@ const config = {
|
||||
'./package.json',
|
||||
],
|
||||
publish: null,
|
||||
afterSign: './scripts/afterSignHook.js',
|
||||
extraResources: [
|
||||
{
|
||||
from: './bin',
|
||||
@@ -46,6 +46,7 @@ const config = {
|
||||
hardenedRuntime: true,
|
||||
category: 'public.app-category.developer-tools',
|
||||
entitlements: './build/static/entitlements.mac.inherit.plist',
|
||||
entitlementsInherit: './build/static/entitlements.mac.inherit.plist',
|
||||
artifactName: `${BINARY_PREFIX}-\${version}.\${ext}`,
|
||||
target: [
|
||||
{
|
||||
@@ -60,6 +61,12 @@ const config = {
|
||||
extendInfo: {
|
||||
NSRequiresAquaSystemAppearance: false,
|
||||
},
|
||||
notarize: {
|
||||
appBundleId: 'com.insomnia.app',
|
||||
},
|
||||
asarUnpack: [
|
||||
'node_modules/@getinsomnia/node-libcurl',
|
||||
],
|
||||
},
|
||||
dmg: {
|
||||
window: {
|
||||
@@ -126,6 +133,9 @@ const config = {
|
||||
},
|
||||
],
|
||||
},
|
||||
snap: {
|
||||
base: 'core22',
|
||||
},
|
||||
};
|
||||
|
||||
const { env: { BUILD_TARGETS }, platform } = process;
|
||||
|
||||
4774
packages/insomnia/package-lock.json
generated
4774
packages/insomnia/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -166,10 +166,9 @@
|
||||
"date-fns": "^2.28.0",
|
||||
"deep-equal": "^1.0.1",
|
||||
"electron": "22.0.0",
|
||||
"electron-builder": "23.0.7",
|
||||
"electron-builder-squirrel-windows": "23.0.7",
|
||||
"electron-builder": "24.0.0-alpha.10",
|
||||
"electron-builder-squirrel-windows": "24.0.0-alpha.10",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-notarize": "^1.1.1",
|
||||
"esbuild": "^0.15.13",
|
||||
"esbuild-plugin-alias": "0.2.1",
|
||||
"esbuild-runner": "^2.2.2",
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// TODO(TSCONVERSION) not entirely sure if this can be in TypeScript or not. If so, need to convert.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const electronNotarize = require('electron-notarize');
|
||||
const appConfig = require('../config/config.json');
|
||||
|
||||
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db
|
||||
module.exports = async function(params) {
|
||||
// Only notarize the app on Mac OS only.
|
||||
if (process.platform !== 'darwin') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Same appId in electron-builder.
|
||||
const { appId } = appConfig;
|
||||
|
||||
const productName = `${params.packager.appInfo.productFilename}.app`;
|
||||
const appPath = path.join(params.appOutDir, productName);
|
||||
if (!fs.existsSync(appPath)) {
|
||||
throw new Error(`Cannot find application at: ${productName}`);
|
||||
}
|
||||
|
||||
if (!process.env.APPLE_ID) {
|
||||
console.log('[aftersign] APPLE_ID env variable not set. Skipping notarization');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!process.env.APPLE_ID_PASSWORD) {
|
||||
console.log('[aftersign] APPLE_ID env variable not set. Skipping notarization');
|
||||
return;
|
||||
}
|
||||
|
||||
const args = {
|
||||
appBundleId: appId,
|
||||
appPath: appPath,
|
||||
appleId: process.env.APPLE_ID,
|
||||
appleIdPassword: process.env.APPLE_ID_PASSWORD,
|
||||
};
|
||||
|
||||
console.log(`[afterSign] Notarizing ${productName} (${appId})`);
|
||||
|
||||
try {
|
||||
await electronNotarize.notarize(args);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user