Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update electron builder to generate separate builds #24588

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,6 @@ jobs:
IOS: ${{ needs.iOS.result }}
WEB: ${{ needs.web.result }}
ANDROID_LINK: ${{steps.get_android_path.outputs.android_path}}
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensify.dmg
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensifyAdHoc.dmg
IOS_LINK: ${{steps.get_ios_path.outputs.ios_path}}
WEB_LINK: https://${{ env.PULL_REQUEST_NUMBER }}.pr-testing.expensify.com
28 changes: 23 additions & 5 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ const macIcon = {
adhoc: './desktop/icon-adhoc.png',
};

const appIds = {
production: 'com.expensifyreactnative.chat',
staging: 'com.expensifyreactnative.dev.chat',
adhoc: 'com.expensifyreactnative.adhoc.chat',
};

const productNames = {
production: 'New Expensify',
staging: 'New Expensify Dev',
adhoc: 'New Expensify AdHoc',
};

const artifactNames = {
production: 'NewExpensify.dmg',
staging: 'NewExpensifyDev.dmg',
adhoc: 'NewExpensifyAdHoc.dmg',
};

const isCorrectElectronEnv = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV);

if (!isCorrectElectronEnv) {
Expand All @@ -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,
},
Expand All @@ -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: [
Expand All @@ -65,7 +83,7 @@ module.exports = {
output: 'desktop-build',
},
protocols: {
name: 'New Expensify',
name: productNames[process.env.ELECTRON_ENV],
schemes: ['new-expensify'],
},
};
Loading