-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create DMGs for x64 and arm64 builds (#135)
* Invoke electron-installer-dmg directly to create DMG * Upload dev build dmgs on buildkite * Distribute universal DMG * Fix universal dmg script * Try a CLI tool for creating DMG files * Fix lint issues * Try suggested fix * Notarize DMG files * Add DMGs to CI artifacts * Remove unnecessary trailing comments from pipeline * Add more Buildkite logs groups in macOS builds * 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 8a4cab7. * Address typos in Buildkite pipeline * Avoid verbose output when rebuilding `fs-xattr` --------- Co-authored-by: Gio Lodi <gio.lodi@automattic.com> * Rebuild native module `fs-xattr` on release builds * Remove package `electron-installer-dmg` --------- Co-authored-by: Philip Jackson <p-jackson@live.com> Co-authored-by: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Co-authored-by: Gio Lodi <gio@mokacoding.com> Co-authored-by: Carlos Garcia <fluiddot@gmail.com> Co-authored-by: Gio Lodi <gio.lodi@automattic.com>
- Loading branch information
1 parent
d98da69
commit dc07384
Showing
5 changed files
with
121 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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' }; | ||
|
||
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` | ||
); | ||
|
||
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( | ||
[ path.join( __dirname, '..', 'node_modules', '.bin', `appdmg` ), specsFile, dmgPath ].join( ' ' ) | ||
); | ||
fs.unlinkSync( specsFile ); |