From 395fd6347751037d461b1a19edf4ead762d5d4d0 Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Thu, 11 Apr 2024 20:26:20 +1200 Subject: [PATCH 01/14] Invoke electron-installer-dmg directly to create DMG --- package-lock.json | 3 +-- package.json | 3 +++ scripts/make-dmg.mjs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 scripts/make-dmg.mjs diff --git a/package-lock.json b/package-lock.json index 892c87379..55e95e00e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "css-loader": "^6.0.0", "ejs": "^3.1.10", "electron": "29.1.0", + "electron-installer-dmg": "^4.0.0", "electron-playwright-helpers": "^1.7.0", "eslint": "^8.0.1", "eslint-config-prettier": "^9.1.0", @@ -9569,7 +9570,6 @@ "resolved": "https://registry.npmjs.org/electron-installer-dmg/-/electron-installer-dmg-4.0.0.tgz", "integrity": "sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==", "dev": true, - "optional": true, "dependencies": { "debug": "^4.3.2", "minimist": "^1.1.1" @@ -28074,7 +28074,6 @@ "resolved": "https://registry.npmjs.org/electron-installer-dmg/-/electron-installer-dmg-4.0.0.tgz", "integrity": "sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==", "dev": true, - "optional": true, "requires": { "appdmg": "^0.6.4", "debug": "^4.3.2", diff --git a/package.json b/package.json index b6f9dd0fb..dbc6ce595 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "make:macos-universal": "SKIP_DMG=true electron-forge make --arch=universal", "make:macos-x64": "SKIP_DMG=true FILE_ARCHITECTURE=x64 electron-forge make --arch=x64 --platform=darwin", "make:macos-arm64": "SKIP_DMG=true FILE_ARCHITECTURE=arm64 electron-forge make --arch=arm64 --platform=darwin", + "make:dmg-x64": "FILE_ARCHITECTURE=x64 node ./scripts/make-dmg.mjs", + "make:dmg-arm64": "FILE_ARCHITECTURE=arm64 node ./scripts/make-dmg.mjs", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx,.js,.jsx,.mjs .", "format": "prettier . --write", @@ -61,6 +63,7 @@ "css-loader": "^6.0.0", "ejs": "^3.1.10", "electron": "29.1.0", + "electron-installer-dmg": "^4.0.0", "electron-playwright-helpers": "^1.7.0", "eslint": "^8.0.1", "eslint-config-prettier": "^9.1.0", diff --git a/scripts/make-dmg.mjs b/scripts/make-dmg.mjs new file mode 100644 index 000000000..7d46b9bc9 --- /dev/null +++ b/scripts/make-dmg.mjs @@ -0,0 +1,44 @@ +import * as path from 'path'; +import { fileURLToPath } from 'url'; +import createDMG from 'electron-installer-dmg'; +import packageJson from '../package.json' assert { type: 'json' }; + +const __dirname = path.dirname( fileURLToPath( import.meta.url ) ); + +const appPath = path.resolve( + __dirname, + '../out', + `${ packageJson.productName }-darwin-${ process.env.FILE_ARCHITECTURE }`, + `${ packageJson.productName }.app` +); + +const dmgPath = path.resolve( + __dirname, + '../out', + `${ packageJson.productName }-darwin-${ process.env.FILE_ARCHITECTURE }.dmg` +); + +await createDMG( { + appPath, + dmgPath, + name: packageJson.productName, + icon: path.resolve( __dirname, '../assets/studio-app-icon.icns' ), + background: path.resolve( __dirname, '../assets/dmg-background.png' ), + contents: [ + { + x: 533, + y: 122, + type: 'file', + path: appPath, + }, + { x: 533, y: 354, type: 'link', path: '/Applications' }, + ], + additionalDMGOptions: { + window: { + size: { + width: 710, + height: 502, + }, + }, + }, +} ); From 173e6e174279514d4914660a2fe4cf64c2359c22 Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Thu, 11 Apr 2024 20:39:57 +1200 Subject: [PATCH 02/14] Upload dev build dmgs on buildkite --- .buildkite/pipeline.yml | 2 ++ fastlane/Fastfile | 12 ++++++++++++ package.json | 1 + 3 files changed, 15 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 301be9645..e2b2151b6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -42,6 +42,7 @@ steps: .buildkite/commands/install-node-dependencies.sh node ./scripts/prepare-dev-build-version.mjs npm run make:macos-{{matrix}} + npm run make:dmg-{{matrix}} echo "--- 📃 Notarizing Binary" bundle exec fastlane notarize_binary @@ -108,6 +109,7 @@ steps: .buildkite/commands/install-node-dependencies.sh node ./scripts/confirm-tag-matches-version.mjs npm run make:macos-{{matrix}} + npm run make:dmg-{{matrix}} echo "--- 📃 Notarizing Binary" bundle exec fastlane notarize_binary diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 719fc5c1d..dc58daf85 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -102,12 +102,24 @@ def distribute_builds( extension: 'app.zip', name: 'Mac Intel' }, + x64_dmg: { + binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-x64', 'Studio.dmg'), + filename_core: 'darwin-x64', + extension: 'dmg', + name: 'Mac Intel (DMG)' + }, arm64: { binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-arm64', 'Studio.app.zip'), filename_core: 'darwin-arm64', extension: 'app.zip', name: 'Mac Apple Silicon' }, + arm64_dmg: { + binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-arm64', 'Studio.dmg'), + filename_core: 'darwin-arm64', + extension: 'dmg', + name: 'Mac Apple Silicon (DMG)' + }, windows: { binary_path: File.join(BUILDS_FOLDER, 'make', 'squirrel.windows', 'x64', 'studio-setup.exe'), filename_core: 'win32', diff --git a/package.json b/package.json index dbc6ce595..5230d51b8 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "make:macos-universal": "SKIP_DMG=true electron-forge make --arch=universal", "make:macos-x64": "SKIP_DMG=true FILE_ARCHITECTURE=x64 electron-forge make --arch=x64 --platform=darwin", "make:macos-arm64": "SKIP_DMG=true FILE_ARCHITECTURE=arm64 electron-forge make --arch=arm64 --platform=darwin", + "make:dmg-universal": "node ./scripts/make-dmg.mjs", "make:dmg-x64": "FILE_ARCHITECTURE=x64 node ./scripts/make-dmg.mjs", "make:dmg-arm64": "FILE_ARCHITECTURE=arm64 node ./scripts/make-dmg.mjs", "publish": "electron-forge publish", From bcc88f977bfe3f19b7bd502f4942e837c7f5a696 Mon Sep 17 00:00:00 2001 From: Wojtek Naruniec Date: Wed, 15 May 2024 14:14:03 +0200 Subject: [PATCH 03/14] Distribute universal DMG --- fastlane/Fastfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index dc58daf85..c85d169a2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -96,6 +96,12 @@ def distribute_builds( extension: 'app.zip', name: 'Mac Universal' }, + mac_universal_dmg: { + binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-universal', 'Studio.dmg'), + filename_core: 'darwin-universal', + extension: 'dmg', + name: 'Mac Universal (DMG)' + }, x64: { binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-x64', 'Studio.app.zip'), filename_core: 'darwin-x64', From 01c984c6cd2b4ed63450460b7cc04ef508516ca5 Mon Sep 17 00:00:00 2001 From: Wojtek Naruniec Date: Wed, 15 May 2024 17:50:50 +0200 Subject: [PATCH 04/14] Fix universal dmg script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5230d51b8..9778cb3eb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "make:macos-universal": "SKIP_DMG=true electron-forge make --arch=universal", "make:macos-x64": "SKIP_DMG=true FILE_ARCHITECTURE=x64 electron-forge make --arch=x64 --platform=darwin", "make:macos-arm64": "SKIP_DMG=true FILE_ARCHITECTURE=arm64 electron-forge make --arch=arm64 --platform=darwin", - "make:dmg-universal": "node ./scripts/make-dmg.mjs", + "make:dmg-universal": "FILE_ARCHITECTURE=universal node ./scripts/make-dmg.mjs", "make:dmg-x64": "FILE_ARCHITECTURE=x64 node ./scripts/make-dmg.mjs", "make:dmg-arm64": "FILE_ARCHITECTURE=arm64 node ./scripts/make-dmg.mjs", "publish": "electron-forge publish", From e490b63d0a8703ee0379e1340d25d3eb1f1e96ec Mon Sep 17 00:00:00 2001 From: Wojtek Naruniec Date: Thu, 16 May 2024 13:08:29 +0200 Subject: [PATCH 05/14] Try a CLI tool for creating DMG files --- .buildkite/commands/prepare-environment.sh | 3 ++ scripts/make-dmg.mjs | 41 +++++++++------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.buildkite/commands/prepare-environment.sh b/.buildkite/commands/prepare-environment.sh index d5648d80a..b2c6bf944 100755 --- a/.buildkite/commands/prepare-environment.sh +++ b/.buildkite/commands/prepare-environment.sh @@ -11,3 +11,6 @@ bundle exec fastlane run configure_apply echo "--- :testflight: Fetching Signing Certificates" bundle exec fastlane set_up_signing + +echo "--- :mac: Installing DMG tool" +brew install create-dmg diff --git a/scripts/make-dmg.mjs b/scripts/make-dmg.mjs index 7d46b9bc9..1e45cf0ef 100644 --- a/scripts/make-dmg.mjs +++ b/scripts/make-dmg.mjs @@ -1,7 +1,7 @@ import * as path from 'path'; import { fileURLToPath } from 'url'; -import createDMG from 'electron-installer-dmg'; import packageJson from '../package.json' assert { type: 'json' }; +import child_process from "child_process"; const __dirname = path.dirname( fileURLToPath( import.meta.url ) ); @@ -18,27 +18,18 @@ const dmgPath = path.resolve( `${ packageJson.productName }-darwin-${ process.env.FILE_ARCHITECTURE }.dmg` ); -await createDMG( { - appPath, - dmgPath, - name: packageJson.productName, - icon: path.resolve( __dirname, '../assets/studio-app-icon.icns' ), - background: path.resolve( __dirname, '../assets/dmg-background.png' ), - contents: [ - { - x: 533, - y: 122, - type: 'file', - path: appPath, - }, - { x: 533, y: 354, type: 'link', path: '/Applications' }, - ], - additionalDMGOptions: { - window: { - size: { - width: 710, - height: 502, - }, - }, - }, -} ); +const volumeIconPath = path.resolve( __dirname, '../assets/studio-app-icon.icns' ); +const backgroundPath = path.resolve( __dirname, '../assets/dmg-background.png' ); + +child_process.execSync( + `create-dmg ` + + `--volname ${packageJson.productName}.app ` + + `--volicon ${volumeIconPath} ` + + '--window-size 710 502 ' + + `--background ${backgroundPath} ` + + `--icon ${packageJson.productName} 533 122 ` + + '--icon-size 80 ' + + '--app-drop-link 533 354 ' + + `${dmgPath} ` + + appPath +); From 4739de4e5fea12e6a0a2f90ac3d95cc0dc183752 Mon Sep 17 00:00:00 2001 From: Wojtek Naruniec Date: Thu, 16 May 2024 13:15:21 +0200 Subject: [PATCH 06/14] Fix lint issues --- scripts/make-dmg.mjs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/make-dmg.mjs b/scripts/make-dmg.mjs index 1e45cf0ef..68ee8d249 100644 --- a/scripts/make-dmg.mjs +++ b/scripts/make-dmg.mjs @@ -1,7 +1,7 @@ +import child_process from 'child_process'; import * as path from 'path'; import { fileURLToPath } from 'url'; import packageJson from '../package.json' assert { type: 'json' }; -import child_process from "child_process"; const __dirname = path.dirname( fileURLToPath( import.meta.url ) ); @@ -23,13 +23,13 @@ const backgroundPath = path.resolve( __dirname, '../assets/dmg-background.png' ) child_process.execSync( `create-dmg ` + - `--volname ${packageJson.productName}.app ` + - `--volicon ${volumeIconPath} ` + - '--window-size 710 502 ' + - `--background ${backgroundPath} ` + - `--icon ${packageJson.productName} 533 122 ` + - '--icon-size 80 ' + - '--app-drop-link 533 354 ' + - `${dmgPath} ` + - appPath + `--volname ${ packageJson.productName }.app ` + + `--volicon ${ volumeIconPath } ` + + '--window-size 710 502 ' + + `--background ${ backgroundPath } ` + + `--icon ${ packageJson.productName } 533 122 ` + + '--icon-size 80 ' + + '--app-drop-link 533 354 ' + + `${ dmgPath } ` + + appPath ); From 498aa7a06d405badefb8f2b2457261772d1c559a Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Fri, 17 May 2024 09:29:51 -0600 Subject: [PATCH 07/14] Try suggested fix --- scripts/make-dmg.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make-dmg.mjs b/scripts/make-dmg.mjs index 68ee8d249..cb44031ad 100644 --- a/scripts/make-dmg.mjs +++ b/scripts/make-dmg.mjs @@ -30,6 +30,7 @@ child_process.execSync( `--icon ${ packageJson.productName } 533 122 ` + '--icon-size 80 ' + '--app-drop-link 533 354 ' + + '--skip-jenkins ' + `${ dmgPath } ` + appPath ); From 4659c3e1617ba1dead9e170de5d9087273600a76 Mon Sep 17 00:00:00 2001 From: Wojtek Naruniec Date: Mon, 20 May 2024 10:28:47 +0200 Subject: [PATCH 08/14] Notarize DMG files --- fastlane/Fastfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c85d169a2..aedda3205 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -45,13 +45,20 @@ lane :set_up_signing do |_options| end desc 'Notarize the compiled binary' -lane :notarize_binary do |_options| +lane :notarize_binary do Dir[File.join(BUILDS_FOLDER, '**', 'Studio.app')].each do |path| notarize( package: path, api_key_path: APPLE_API_KEY_PATH ) end + Dir[File.join(BUILDS_FOLDER, '**', 'Studio-*.dmg')].each do |path| + notarize( + bundle_id: APPLE_BUNDLE_IDENTIFIER, + package: path, + api_key_path: APPLE_API_KEY_PATH + ) + end end desc 'Ship the binary to internal testers' From 57750eb75fc4945b3fa89e61962822a2fe392148 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 21 May 2024 16:31:51 +1000 Subject: [PATCH 09/14] Add DMGs to CI artifacts --- .buildkite/pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e2b2151b6..8e03bd877 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -50,6 +50,7 @@ steps: plugins: *common_plugins artifact_paths: - 'out/**/*.app.zip' + - 'out/*.dmg' matrix: - "universal" - "x64" @@ -117,6 +118,7 @@ steps: plugins: *common_plugins artifact_paths: - 'out/**/*.app.zip' + - 'out/*.dmg' matrix: - "universal" - "x64" From f8140f60f17b5e9358022285b92cc0fe3dde6e25 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 21 May 2024 16:32:30 +1000 Subject: [PATCH 10/14] Remove unnecessary trailing comments from pipeline --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 8e03bd877..e7e76c8e2 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -87,7 +87,7 @@ steps: artifact_paths: - 'out/releases.json' agents: - queue: "mac" # + queue: "mac" # Using concurrency_group to ensure the CI builds from `trunk` & the git tag, which are likely to run at roughly the # same time, don't run into a race condition when downloading+updating+uploading the `releases.json` file from/to S3 concurrency_group: 'studio/release-manifest-update' @@ -155,7 +155,7 @@ steps: artifact_paths: - 'out/releases.json' agents: - queue: "mac" # + queue: "mac" # Using concurrency_group to ensure the CI builds from `trunk` & the git tag, which are likely to run at roughly the # same time, don't run into a race condition when downloading+updating+uploading the `releases.json` file from/to S3 concurrency_group: 'studio/release-manifest-update' From 00453c7b61f164f5cf7d0969016cd00ef114eca8 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 25 Jun 2024 15:18:06 +1000 Subject: [PATCH 11/14] Add more Buildkite logs groups in macOS builds --- .buildkite/pipeline.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a7da70281..0342419c1 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -71,10 +71,13 @@ steps: command: | .buildkite/commands/prepare-environment.sh - echo "--- :node: Building Binary" .buildkite/commands/install-node-dependencies.sh node ./scripts/prepare-dev-build-version.mjs + + echo "--- :node: Building Binary" npm run make:macos-{{matrix}} + + echo "--- :node: Packaging in DMG" npm run make:dmg-{{matrix}} echo "--- 📃 Notarizing Binary" @@ -141,10 +144,13 @@ steps: command: | .buildkite/commands/prepare-environment.sh - echo "--- :node: Building Binary" .buildkite/commands/install-node-dependencies.sh node ./scripts/confirm-tag-matches-version.mjs + + echo "--- :node: Building Binary" npm run make:macos-{{matrix}} + + echo "--- :node: Packaging in DMG" npm run make:dmg-{{matrix}} echo "--- 📃 Notarizing Binary" From 284fd5efa847ad77ce4ca7cfe925c9f044f34873 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 1 Jul 2024 12:26:01 +0200 Subject: [PATCH 12/14] Build DMG files with `appdmg` (#299) * Use `appdmg` in `made-dmg` script * Do not install `create-dmg` in Buildkite * Rebuild specific node native modules * [TEST] Log native module rebuild * Conditionally rebuild `fs-xattr` before packaging DMG to fix dlopen issue (#321) * Install Rosetta on macOS Try to address https://buildkite.com/automattic/studio/builds/1543#01904ffb-8498-4d13-aa5a-e2b3c6dbb302 * Rebuild fs-xatrr after binary has been built, conditionally * Revert "Install Rosetta on macOS" This reverts commit 8a4cab7724d52d24e9af1015aee5597d510e8f1c. * Address typos in Buildkite pipeline * Avoid verbose output when rebuilding `fs-xattr` --------- Co-authored-by: Gio Lodi --- .buildkite/commands/prepare-environment.sh | 5 +--- .buildkite/pipeline.yml | 17 ++++++++++++ scripts/make-dmg.mjs | 32 ++++++++++++++-------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/.buildkite/commands/prepare-environment.sh b/.buildkite/commands/prepare-environment.sh index b2c6bf944..6cbc984be 100755 --- a/.buildkite/commands/prepare-environment.sh +++ b/.buildkite/commands/prepare-environment.sh @@ -10,7 +10,4 @@ echo "--- :closed_lock_with_key: Installing Secrets" bundle exec fastlane run configure_apply echo "--- :testflight: Fetching Signing Certificates" -bundle exec fastlane set_up_signing - -echo "--- :mac: Installing DMG tool" -brew install create-dmg +bundle exec fastlane set_up_signing \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0342419c1..9c280eb26 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -72,11 +72,28 @@ steps: .buildkite/commands/prepare-environment.sh .buildkite/commands/install-node-dependencies.sh + node ./scripts/prepare-dev-build-version.mjs echo "--- :node: Building Binary" npm run make:macos-{{matrix}} + # Local trial and error show this needs to run before the DMG generation (obviously) but after the binary has been built + echo "--- :hammer: Rebuild fs-attr if necessary before generating DMG" + case {{matrix}} in + universal | x64) + echo "Rebuilding fs-xattr for {{matrix}} architecture" + npm rebuild fs-xattr --cpu universal + ;; + arm64) + echo "No need to rebuild fs-xattr because it works out of the box on Apple Silicon" + ;; + *) + echo "^^^ +++ Unexpected architecture {{matrix}}" + exit 1 + ;; + esac + echo "--- :node: Packaging in DMG" npm run make:dmg-{{matrix}} diff --git a/scripts/make-dmg.mjs b/scripts/make-dmg.mjs index cb44031ad..5d21d8b0d 100644 --- a/scripts/make-dmg.mjs +++ b/scripts/make-dmg.mjs @@ -1,4 +1,5 @@ import child_process from 'child_process'; +import * as fs from 'fs'; import * as path from 'path'; import { fileURLToPath } from 'url'; import packageJson from '../package.json' assert { type: 'json' }; @@ -21,16 +22,25 @@ const dmgPath = path.resolve( const volumeIconPath = path.resolve( __dirname, '../assets/studio-app-icon.icns' ); const backgroundPath = path.resolve( __dirname, '../assets/dmg-background.png' ); +const dmgSpecs = { + title: packageJson.productName, + icon: volumeIconPath, + 'icon-size': 80, + background: backgroundPath, + window: { size: { width: 710, height: 502 } }, + contents: [ + { type: 'file', path: appPath, x: 533, y: 122 }, + { type: 'link', path: '/Applications', x: 533, y: 354 }, + ], +}; + +if ( fs.existsSync( dmgPath ) ) { + fs.unlinkSync( dmgPath ); +} + +const specsFile = path.resolve( __dirname, '..', 'appdmg-specs.json' ); +fs.writeFileSync( specsFile, JSON.stringify( dmgSpecs ) ); child_process.execSync( - `create-dmg ` + - `--volname ${ packageJson.productName }.app ` + - `--volicon ${ volumeIconPath } ` + - '--window-size 710 502 ' + - `--background ${ backgroundPath } ` + - `--icon ${ packageJson.productName } 533 122 ` + - '--icon-size 80 ' + - '--app-drop-link 533 354 ' + - '--skip-jenkins ' + - `${ dmgPath } ` + - appPath + [ path.join( __dirname, '..', 'node_modules', '.bin', `appdmg` ), specsFile, dmgPath ].join( ' ' ) ); +fs.unlinkSync( specsFile ); From adee140b09c0e8e59733a1b6d30048588ca443e0 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 1 Jul 2024 12:30:49 +0200 Subject: [PATCH 13/14] Rebuild native module `fs-xattr` on release builds --- .buildkite/pipeline.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9c280eb26..1071af75c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -167,6 +167,22 @@ steps: echo "--- :node: Building Binary" npm run make:macos-{{matrix}} + # Local trial and error show this needs to run before the DMG generation (obviously) but after the binary has been built + echo "--- :hammer: Rebuild fs-attr if necessary before generating DMG" + case {{matrix}} in + universal | x64) + echo "Rebuilding fs-xattr for {{matrix}} architecture" + npm rebuild fs-xattr --cpu universal + ;; + arm64) + echo "No need to rebuild fs-xattr because it works out of the box on Apple Silicon" + ;; + *) + echo "^^^ +++ Unexpected architecture {{matrix}}" + exit 1 + ;; + esac + echo "--- :node: Packaging in DMG" npm run make:dmg-{{matrix}} From 3ac04d1453ee8ce06bd79b46f36ea4273cf2fa3f Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 1 Jul 2024 12:31:40 +0200 Subject: [PATCH 14/14] Remove package `electron-installer-dmg` --- package-lock.json | 3 ++- package.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f129cdec..2d4c72547 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,7 +75,6 @@ "css-loader": "^6.0.0", "ejs": "^3.1.10", "electron": "29.1.0", - "electron-installer-dmg": "^4.0.0", "electron-playwright-helpers": "^1.7.0", "eslint": "^8.0.1", "eslint-config-prettier": "^9.1.0", @@ -9802,6 +9801,7 @@ "resolved": "https://registry.npmjs.org/electron-installer-dmg/-/electron-installer-dmg-4.0.0.tgz", "integrity": "sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==", "dev": true, + "optional": true, "dependencies": { "debug": "^4.3.2", "minimist": "^1.1.1" @@ -29608,6 +29608,7 @@ "resolved": "https://registry.npmjs.org/electron-installer-dmg/-/electron-installer-dmg-4.0.0.tgz", "integrity": "sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==", "dev": true, + "optional": true, "requires": { "appdmg": "^0.6.4", "debug": "^4.3.2", diff --git a/package.json b/package.json index c0358eea3..b7cfada23 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "css-loader": "^6.0.0", "ejs": "^3.1.10", "electron": "29.1.0", - "electron-installer-dmg": "^4.0.0", "electron-playwright-helpers": "^1.7.0", "eslint": "^8.0.1", "eslint-config-prettier": "^9.1.0",