-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app-shell): Update Electron and add macOS app notarization (#4011)
- Loading branch information
Showing
11 changed files
with
658 additions
and
454 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use strict' | ||
const path = require('path') | ||
|
||
const { OT_APP_DEPLOY_BUCKET, OT_APP_DEPLOY_FOLDER } = process.env | ||
const DEV_MODE = process.env.NODE_ENV !== 'production' | ||
|
||
module.exports = { | ||
appId: 'com.opentrons.app', | ||
electronVersion: '6.0.7', | ||
files: [ | ||
'**/*', | ||
{ | ||
from: '../app/dist', | ||
to: './ui', | ||
filter: ['**/*'], | ||
}, | ||
'build/release-notes.md', | ||
'build/br-premigration-wheels', | ||
'!Makefile', | ||
], | ||
/* eslint-disable no-template-curly-in-string */ | ||
artifactName: DEV_MODE | ||
? '${productName}-v${version}-${os}-${dev}.${ext}' | ||
: '${productName}-v${version}-${os}-${env.BUILD_ID}.${ext}', | ||
/* eslint-enable no-template-curly-in-string */ | ||
asar: true, | ||
mac: { | ||
target: process.platform === 'darwin' ? ['dmg', 'zip'] : ['zip'], | ||
category: 'public.app-category.productivity', | ||
type: DEV_MODE ? 'development' : 'distribution', | ||
}, | ||
dmg: { | ||
icon: null, | ||
}, | ||
win: { | ||
target: ['nsis'], | ||
publisherName: 'Opentrons Labworks Inc.', | ||
}, | ||
nsis: { | ||
oneClick: false, | ||
}, | ||
linux: { | ||
target: ['AppImage'], | ||
executableName: 'opentrons', | ||
category: 'Science', | ||
}, | ||
publish: | ||
OT_APP_DEPLOY_BUCKET && OT_APP_DEPLOY_FOLDER | ||
? { | ||
provider: 's3', | ||
bucket: OT_APP_DEPLOY_FOLDER, | ||
path: OT_APP_DEPLOY_FOLDER, | ||
} | ||
: null, | ||
generateUpdatesFilesForAllChannels: true, | ||
afterSign: path.join(__dirname, './scripts/after-sign.js'), | ||
} |
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
const { notarize } = require('electron-notarize') | ||
const { appId } = require('../electron-builder.config') | ||
|
||
const { APPLE_ID, APPLE_ID_PASSWORD } = process.env | ||
const DEV_MODE = process.env.NODE_ENV !== 'production' | ||
const PLATFORM_DARWIN = 'darwin' | ||
|
||
module.exports = function afterSign(context) { | ||
const { electronPlatformName, appOutDir } = context | ||
|
||
if ( | ||
process.platform !== PLATFORM_DARWIN || | ||
electronPlatformName !== PLATFORM_DARWIN | ||
) { | ||
console.log( | ||
'Not running on and/or building for macOS; skipping notarization' | ||
) | ||
return Promise.resolve() | ||
} | ||
|
||
if (DEV_MODE) { | ||
console.log('Not in a production environment; skipping notarization') | ||
return Promise.resolve() | ||
} | ||
|
||
if (!APPLE_ID || !APPLE_ID_PASSWORD) { | ||
console.warn( | ||
'No Apple Account credentials available; skipping notarization' | ||
) | ||
return Promise.resolve() | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename | ||
const appPath = path.join(appOutDir, `${appName}.app`) | ||
|
||
console.log(`Submitting app for notarization: ${appPath}`) | ||
|
||
return notarize({ | ||
appBundleId: appId, | ||
appleId: APPLE_ID, | ||
appleIdPassword: APPLE_ID_PASSWORD, | ||
appPath, | ||
}) | ||
} |
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 |
---|---|---|
|
@@ -37,6 +37,9 @@ install: | |
- ps: Install-Product node $env:nodejs_version x64 | ||
# install dev dependencies | ||
- cmd: '%MAKE% -j 2 install' | ||
# TODO(mc, 2019-09-09): remove this workaround when this issue is fixed: | ||
# https://github.com/electron-userland/electron-builder/issues/4092 | ||
- cmd: 'yarn add -DW [email protected]' | ||
|
||
# do not run MSBuild | ||
build: false | ||
|
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
Oops, something went wrong.