From b6689a9e3dd5821f7cfbfc48e4d0b7ef8485537b Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Tue, 15 Aug 2023 20:51:33 +0500 Subject: [PATCH] feat: update electron builder to generate separate builds --- config/electronBuilder.config.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index da87c93ee367..4423be7aefe9 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -21,6 +21,24 @@ const macIcon = { adhoc: './desktop/icon-adhoc.png', }; +const appIds = { + production: 'com.expensifyreactnative.chat', + staging: 'com.expensifyreactnative.staging.chat', + adhoc: 'com.expensifyreactnative.adhoc.chat', +}; + +const productNames = { + production: 'New Expensify', + staging: 'New Expensify Staging', + adhoc: 'New Expensify AdHoc', +}; + +const artifactNames = { + production: 'NewExpensify.dmg', + staging: 'NewExpensifyStaging.dmg', + adhoc: 'NewExpensifyAdHoc.dmg', +}; + const isCorrectElectronEnv = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV); if (!isCorrectElectronEnv) { @@ -32,8 +50,8 @@ if (!isCorrectElectronEnv) { * It can be used to create local builds of the same, by omitting the `--publish` flag */ module.exports = { - appId: 'com.expensifyreactnative.chat', - productName: 'New Expensify', + appId: appIds[process.env.ELECTRON_ENV], + productName: productNames[process.env.ELECTRON_ENV], extraMetadata: { version, }, @@ -46,8 +64,8 @@ module.exports = { type: 'distribution', }, dmg: { - title: 'New Expensify', - artifactName: 'NewExpensify.dmg', + title: productNames[process.env.ELECTRON_ENV], + artifactName: artifactNames[process.env.ELECTRON_ENV], internetEnabled: true, }, publish: [ @@ -65,7 +83,7 @@ module.exports = { output: 'desktop-build', }, protocols: { - name: 'New Expensify', + name: productNames[process.env.ELECTRON_ENV], schemes: ['new-expensify'], }, };