-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update electron to currently supported version (#9053)
* chore: update electron to currently supported version * Trigger build * Use Electron v14.2.6 * Trigger build * Fix mac signing process * Implement custom electron build fetching * fix path * Fix file ending
- Loading branch information
Showing
13 changed files
with
132 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ dist/ | |
locales/en-US-pseudo.json | ||
l10ntemp/ | ||
oneauth-temp | ||
customElectron | ||
electron-builder-config-*.json |
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
35 changes: 35 additions & 0 deletions
35
Composer/packages/electron-server/scripts/createBuilderConfig.js
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,35 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
const { join, resolve } = require('path'); | ||
const { writeFileSync } = require('fs'); | ||
|
||
const packageJson = require('../package.json'); | ||
|
||
const electronVersion = packageJson.devDependencies.electron; | ||
|
||
const electronServerDir = resolve(__dirname, '..'); | ||
|
||
const createBuilderConfig = (platform) => { | ||
const builderConfig = require('../electron-builder-config.json'); | ||
const configName = `electron-builder-config-${platform}.json`; | ||
switch (platform) { | ||
case 'mac': | ||
case 'linux': | ||
builderConfig.electronDownload = { | ||
version: electronVersion, | ||
}; | ||
break; | ||
case 'win': | ||
builderConfig.electronDist = 'customElectron'; | ||
break; | ||
default: | ||
throw new Error( | ||
`Invalid platform specified for builder config generation (${platform}). Supported platforms are: mac, linux and windows` | ||
); | ||
} | ||
writeFileSync(join(electronServerDir, configName), JSON.stringify(builderConfig, null, 2)); | ||
return configName; | ||
}; | ||
|
||
exports.createBuilderConfig = createBuilderConfig; |
41 changes: 41 additions & 0 deletions
41
Composer/packages/electron-server/scripts/downloadAndExtractElectron.js
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,41 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
const { join } = require('path'); | ||
|
||
const { download } = require('@electron/get'); | ||
const extract = require('extract-zip'); | ||
|
||
const packageJson = require('../package.json'); | ||
|
||
const { log } = require('./common'); | ||
|
||
const electronVersion = packageJson.devDependencies.electron; | ||
|
||
async function downloadAndExtract() { | ||
// download the custom build of Electron | ||
const zipPath = await download(electronVersion, { | ||
mirrorOptions: { | ||
mirror: process.env.MSFT_ELECTRON_MIRROR, | ||
customDir: process.env.MSFT_ELECTRON_DIR, | ||
}, | ||
}); | ||
log.info(`Electron successfully downloaded to ${zipPath}`); | ||
|
||
// extract the custom build into a local directory | ||
const extractPath = join(__dirname, '..', 'customElectron'); | ||
await extract(zipPath, { dir: extractPath }); | ||
log.info(`Electron successfully unzipped in ${extractPath}`); | ||
|
||
return extractPath; | ||
} | ||
|
||
downloadAndExtract() | ||
.then((extractPath) => log.info(`Downloaded and extracted the internal Electron build to ${extractPath}`)) | ||
.catch((err) => { | ||
log.error(`Error downloading and extracting the internal Electron build: ${err}`); | ||
throw err; | ||
}); |
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
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