-
Notifications
You must be signed in to change notification settings - Fork 18
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
Create DMGs for x64 and arm64 builds #135
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
395fd63
Invoke electron-installer-dmg directly to create DMG
p-jackson 173e6e1
Upload dev build dmgs on buildkite
p-jackson bcc88f9
Distribute universal DMG
wojtekn 01c984c
Fix universal dmg script
wojtekn e490b63
Try a CLI tool for creating DMG files
wojtekn 4739de4
Fix lint issues
wojtekn 498aa7a
Try suggested fix
jkmassel 4659c3e
Notarize DMG files
wojtekn 57750eb
Add DMGs to CI artifacts
mokagio f8140f6
Remove unnecessary trailing comments from pipeline
mokagio 9a99bd9
Merge branch 'trunk' into update/build-dmg-manually
fluiddot e311f51
Merge remote-tracking branch 'origin/trunk' into update/build-dmg-man…
mokagio 00453c7
Add more Buildkite logs groups in macOS builds
mokagio 284fd5e
Build DMG files with `appdmg` (#299)
fluiddot adee140
Rebuild native module `fs-xattr` on release builds
fluiddot 3ac04d1
Remove package `electron-installer-dmg`
fluiddot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -96,18 +103,36 @@ 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)' | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad the DRY from #117 turned out to be useful. I wasn't expecting us to add new files to upload, but there you go. Happy it was here. |
||
x64: { | ||
binary_path: File.join(BUILDS_FOLDER, 'Studio-darwin-x64', 'Studio.app.zip'), | ||
filename_core: 'darwin-x64', | ||
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', | ||
|
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 ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it happen after we notarize the binary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what the docs say:
So, I think in our case, given we distribute both
.app
and.dmg
, we'll want to notarize both. If we were only distributing the DMG, we could notarize just that and trust Apple's tooling will handle it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a local notarization of a DMG built from this branch, as of d538a17, and this diff worked: