From e3038a33933d862774ef90ff87845b4dbf2e48db Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Fri, 17 Nov 2023 05:51:47 -0800 Subject: [PATCH] MacOS app to be built on each release build Summary: So far we have used a 'template' approach, in which the release build script will copy and use to create the final deliverable. The template itself was updated locally by running: cd ~/fbsource/xplat/sonar/facebook/flipper-server yarn start This would: - Build the MacOS app for all supported architectures: x64 and arm64 - Update the template found on the static directory After the update, we would just commit the changes to the repo. ## About this change Instead, build the MacOS app when the release script is used. This is leaves way less margin for error as we have removed all the manual steps that had to be done as listed above. Reviewed By: antonk52 Differential Revision: D51397661 fbshipit-source-id: 2234c9996fa98f32db244764acf3e35dc9a388c9 --- desktop/scripts/build-flipper-server-release.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/desktop/scripts/build-flipper-server-release.tsx b/desktop/scripts/build-flipper-server-release.tsx index bd58b1f84..fa0cf6d34 100644 --- a/desktop/scripts/build-flipper-server-release.tsx +++ b/desktop/scripts/build-flipper-server-release.tsx @@ -746,12 +746,28 @@ async function setUpMacBundle( let appTemplate = path.join(staticDir, 'flipper-server-app-template'); if (isFB) { + const {BuildArchitecture, buildFlipperServer} = await import( + // @ts-ignore only used inside Meta + './fb/build-flipper-server-macos' + ); + + const architecture = + platform === BuildPlatform.MAC_AARCH64 + ? BuildArchitecture.MAC_AARCH64 + : BuildArchitecture.MAC_X64; + const outputPath = await buildFlipperServer(architecture); + console.log( + `⚙️ Successfully built platform: ${platform}, output: ${outputPath}`, + ); + appTemplate = path.join( staticDir, 'facebook', 'flipper-server-app-template', platform, ); + + await fs.copy(outputPath, path.join(appTemplate, 'Flipper.app')); console.info('⚙️ Using internal template from: ' + appTemplate); }