Merge remote-tracking branch 'origin/generate-forge-config-on-build' into ICU-1356-enable-windows-platform-support

This commit is contained in:
Susmitha Girumala committed 2021-05-27 10:36:00 -04:00
commit 343f85f8e7
7 files changed
+20 -42

No files matched your search

+2 -33
View File
@@ -3,55 +3,24 @@ const path = require('path');
// Create config for use in electron forge
const createConfig = () => {
const configPath = path.join(__dirname, '..', 'config');
const macosConfigPath = path.join(configPath, 'macos');
const appIconPath = path.join(configPath, 'app-icons', 'icon');
const config = {
name: 'boundary',
productName: 'Boundary',
bundleId: 'com.electron.boundary',
copyright: `Copyright © ${new Date().getFullYear()} HashiCorp, Inc.`,
releaseVersion: process.env.RELEASE_VERSION,
releaseCommit: process.env.RELEASE_COMMIT,
icon: appIconPath,
macos: {
hardenedRuntime: true,
entitlements: path.join(macosConfigPath, 'entitlements.plist'),
signatureFlags: 'library',
signingIdentity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY,
dmg: {
diskIcon: path.join(macosConfigPath, 'disk.icns'),
background: path.join(macosConfigPath, 'background.png'),
},
},
};
if (!config.releaseVersion) {
config.releaseVersion = '0.0.0';
console.warn(
`[desktop-config] Release version not specified. Using: ${config.releaseVersion} instead`
);
}
console.log(`[desktop-config] Release commit: ${config.releaseCommit}`);
console.log(`[desktop-config] Release version: ${config.releaseVersion}`);
// MacOS signing identity
if (!config.macos.signingIdentity)
console.warn(
'[desktop-config] WARNING: Could not find signing identity. Proceeding without signing.'
);
if (!config.releaseVersion) config.releaseVersion = '0.0.0';
return config;
};
// Save config file
const saveConfig = (config, destination) => {
const configPath = `${destination}/config.js`;
console.log(`[desktop-config] Config: ${configPath}`);
const content = `module.exports = ${JSON.stringify(config, null, 2)}`;
fs.writeFileSync(configPath, content);
console.log(`Create: ${configPath}`);
};
module.exports = {
+18 -9
View File
@@ -1,20 +1,29 @@
// Generated during build
const config = require('./config.js');
console.log(`\n[forge-config] Release commit: ${config.releaseCommit}`);
console.log(`[forge-config] Release version: ${config.releaseVersion}`);
// MacOS signing identity
if (process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY)
console.warn(
'[forge-config] WARNING: Could not find signing identity. Proceeding without signing.'
);
module.exports = {
packagerConfig: {
ignore: ['/ember-test(/|$)', '/tests(/|$)'],
icon: config.icon,
icon: './assets/app-icons/icon',
name: config.productName,
appVersion: config.version,
appBundleId: config.bundleId,
appBundleId: 'com.electron.boundary',
appCopyright: config.copyright,
osxSign: {
identity: config.macos.signingIdentity,
'hardened-runtime': config.macos.hardenedRuntime,
entitlements: config.macos.entitlements,
'entitlements-inherit': config.macos.entitlements,
'signature-flags': config.macos.signatureFlags,
identity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY,
'hardened-runtime': true,
entitlements: './assets/macos/entitlements.plist',
'entitlements-inherit': './assets/macos/entitlements.plist',
'signature-flags': 'library',
},
},
makers: [
@@ -26,8 +35,8 @@ module.exports = {
config: {
title: config.productName,
name: config.name,
icon: config.macos.dmg.diskIcon,
background: config.macos.dmg.background,
icon: './assets/macos/disk.icns',
background: './assets/macos/background.png',
},
},
{