feat: Improve build scripts signing (#4)

This commit is contained in:
Eric Tuvesson
2024-03-26 22:32:04 +01:00
committed by GitHub
parent ff3b29b097
commit da0a17a6e8
3 changed files with 12 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import { BuildTarget, getDistPlatform } from './platform/build-platforms';
// Inputs // Inputs
const DISABLE_SIGNING = valueToBoolean(process.env.DISABLE_SIGNING); const DISABLE_SIGNING = valueToBoolean(process.env.DISABLE_SIGNING);
const TARGET_PLATFORM = process.env.TARGET_PLATFORM; const TARGET_PLATFORM = process.env.TARGET_PLATFORM;
const CSC_NAME = process.env.CSC_NAME;
if (!TARGET_PLATFORM) throw new Error('TARGET_PLATFORM is falsy'); if (!TARGET_PLATFORM) throw new Error('TARGET_PLATFORM is falsy');
@@ -48,7 +49,7 @@ import { BuildTarget, getDistPlatform } from './platform/build-platforms';
DISABLE_SIGNING DISABLE_SIGNING
? {} ? {}
: { : {
// CSC_NAME: 'Add signing name here' CSC_NAME
}, },
process.env process.env
) )

View File

@@ -15,6 +15,8 @@ const SKIP_GIT_CHECK = args.includes('--skip-git');
const WORKSPACE_PATH = path.resolve(__dirname, '..'); const WORKSPACE_PATH = path.resolve(__dirname, '..');
const TARGET_PLATFORM = process.env.TARGET_PLATFORM || getCurrentPlatform(); const TARGET_PLATFORM = process.env.TARGET_PLATFORM || getCurrentPlatform();
const DISABLE_SIGNING = process.env.DISABLE_SIGNING;
const CSC_NAME = process.env.CSC_NAME;
// Debug Configuration // Debug Configuration
console.log('--- Configuration'); console.log('--- Configuration');
@@ -73,6 +75,8 @@ try {
env: { env: {
...process.env, ...process.env,
WORKSPACE_PATH, WORKSPACE_PATH,
DISABLE_SIGNING,
CSC_NAME,
} }
}); });
} catch (error) { } catch (error) {
@@ -82,7 +86,7 @@ try {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
// NOTE: /node_modules/app-builder-lib/templates/entitlements.mac.plist is missing // NOTE: /node_modules/app-builder-lib/templates/entitlements.mac.plist is missing
execSync(`ls /node_modules/app-builder-lib/templates`, { execSync(`ls ./node_modules/app-builder-lib/templates`, {
stdio: 'inherit', stdio: 'inherit',
env: process.env env: process.env
}); });

View File

@@ -12,7 +12,9 @@ import { getCurrentPlatform } from '../helper';
// Inputs // Inputs
const WORKSPACE_PATH = path.resolve(__dirname, '../..'); const WORKSPACE_PATH = path.resolve(__dirname, '../..');
const DISABLE_SIGNING = process.env.DISABLE_SIGNING;
const TARGET_PLATFORM = process.env.TARGET_PLATFORM || getCurrentPlatform(); const TARGET_PLATFORM = process.env.TARGET_PLATFORM || getCurrentPlatform();
const CSC_NAME = process.env.CSC_NAME;
// Variables // Variables
const noodlEditorPath = path.join(WORKSPACE_PATH, 'packages', 'noodl-editor'); const noodlEditorPath = path.join(WORKSPACE_PATH, 'packages', 'noodl-editor');
@@ -93,7 +95,9 @@ import { getCurrentPlatform } from '../helper';
stdio: 'inherit', stdio: 'inherit',
env: { env: {
...process.env, ...process.env,
TARGET_PLATFORM TARGET_PLATFORM,
DISABLE_SIGNING,
CSC_NAME,
} }
}); });
console.log("--- 'npm run build' done!"); console.log("--- 'npm run build' done!");