mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
319 Commits
refactor/a
...
v31.7.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b1cdbb563 | ||
|
|
beb7f9e9d9 | ||
|
|
a25d146cb7 | ||
|
|
a2a644e948 | ||
|
|
8b060dc73e | ||
|
|
8382471e2e | ||
|
|
c200b6762b | ||
|
|
7691f58861 | ||
|
|
fb47716885 | ||
|
|
efa354e9d9 | ||
|
|
67ccd2792e | ||
|
|
0c83fb1540 | ||
|
|
2bd3a9fe65 | ||
|
|
9c5c5d0fea | ||
|
|
b6e16fa18d | ||
|
|
d85a59b6ea | ||
|
|
a05ebed03d | ||
|
|
2d150ccb33 | ||
|
|
7037042566 | ||
|
|
b0698ec9f4 | ||
|
|
aa16c04abc | ||
|
|
15f8a19c98 | ||
|
|
098680c4bb | ||
|
|
17c9c79202 | ||
|
|
9e9bb3dc7a | ||
|
|
1e000ff2d6 | ||
|
|
87947793d5 | ||
|
|
c6714ee45c | ||
|
|
afad838a8b | ||
|
|
a826f895d2 | ||
|
|
028863a93c | ||
|
|
ff024cd396 | ||
|
|
c2c6bc57c1 | ||
|
|
2f247ad050 | ||
|
|
9d2c0ac9fe | ||
|
|
00e5d0ad56 | ||
|
|
1ab051bb69 | ||
|
|
48b962898d | ||
|
|
dce705efc0 | ||
|
|
e206378680 | ||
|
|
4ccf4fa97d | ||
|
|
d262568f77 | ||
|
|
dbfe4742d5 | ||
|
|
478defb15c | ||
|
|
ba88433eb3 | ||
|
|
ba6d9291d2 | ||
|
|
6da785fd10 | ||
|
|
daca2d327f | ||
|
|
f7159b6898 | ||
|
|
8e1e4541af | ||
|
|
01e64d3932 | ||
|
|
075a297347 | ||
|
|
5bdaa42b01 | ||
|
|
9222396159 | ||
|
|
a0802f7ce6 | ||
|
|
9ee51dbe92 | ||
|
|
0a4b0de4f7 | ||
|
|
c895d45a6d | ||
|
|
60e0355b73 | ||
|
|
6010fda0c7 | ||
|
|
514fc26eb2 | ||
|
|
af9969a3ff | ||
|
|
328afb8a09 | ||
|
|
a66e01b555 | ||
|
|
e99de2b5c6 | ||
|
|
6c1233a7d2 | ||
|
|
3c7a49fdb1 | ||
|
|
d241d1f3b3 | ||
|
|
1495f01e2e | ||
|
|
ad82142eb0 | ||
|
|
a5f4f08a9e | ||
|
|
d8e3555e01 | ||
|
|
f15fea8d03 | ||
|
|
615825f40e | ||
|
|
67590867c1 | ||
|
|
f387325079 | ||
|
|
4e5de0ca44 | ||
|
|
2cc8a33f11 | ||
|
|
ec63fbf0b1 | ||
|
|
5aaf470e78 | ||
|
|
a164109d50 | ||
|
|
6652a3e05c | ||
|
|
7fdf729ca2 | ||
|
|
334a3fbea6 | ||
|
|
568314240e | ||
|
|
48805ee46e | ||
|
|
e62c322b2d | ||
|
|
ea3c48e7c1 | ||
|
|
062d3b8161 | ||
|
|
d519913bfa | ||
|
|
c5e1a336f2 | ||
|
|
0846294d70 | ||
|
|
c481be0028 | ||
|
|
ca2a30c484 | ||
|
|
ee572aac74 | ||
|
|
f93cc252ba | ||
|
|
87f5d788c0 | ||
|
|
99416b8576 | ||
|
|
2c3416627f | ||
|
|
54899c3b4b | ||
|
|
f292be6630 | ||
|
|
43687aca8a | ||
|
|
96fe03b200 | ||
|
|
4b5d29201c | ||
|
|
f6bc0b0953 | ||
|
|
e4113ddd69 | ||
|
|
4de345574a | ||
|
|
97f0a9a545 | ||
|
|
e3908eca41 | ||
|
|
87ecd1e62b | ||
|
|
a3a595383d | ||
|
|
00c0948e7b | ||
|
|
5f97f97f7c | ||
|
|
5c424edcca | ||
|
|
9da190f786 | ||
|
|
a461a95b60 | ||
|
|
98c7dfbdaf | ||
|
|
722bc116f8 | ||
|
|
9bc59d1c2b | ||
|
|
73f43ae46b | ||
|
|
cb7eb6747d | ||
|
|
3b3f2112d5 | ||
|
|
d025ecfa6b | ||
|
|
523b4cb27a | ||
|
|
16a8ac15be | ||
|
|
f7404bceea | ||
|
|
0fa92e0fea | ||
|
|
44e57c6cbb | ||
|
|
3251f84328 | ||
|
|
62c63ea35a | ||
|
|
a373ab027b | ||
|
|
557d5c901a | ||
|
|
1b657869c2 | ||
|
|
a7459bc93b | ||
|
|
5080b647c8 | ||
|
|
aa47f3efc3 | ||
|
|
3596197562 | ||
|
|
054679ee99 | ||
|
|
7df2211c30 | ||
|
|
b80d708fc1 | ||
|
|
a959476dc2 | ||
|
|
bd70c3a740 | ||
|
|
997afe62f2 | ||
|
|
dd1dcad81c | ||
|
|
10dd33c16e | ||
|
|
c3a7f0001c | ||
|
|
a780a75dec | ||
|
|
6e69cb0191 | ||
|
|
520a147244 | ||
|
|
36cebb95c6 | ||
|
|
be842d6267 | ||
|
|
8fb3a04eee | ||
|
|
17cb664e39 | ||
|
|
54b31f153c | ||
|
|
cbf1adb1b7 | ||
|
|
3f0dcb75df | ||
|
|
7da10ffced | ||
|
|
a9f81e63c4 | ||
|
|
1c368f13f8 | ||
|
|
2ad5d1ff71 | ||
|
|
f3fc1e626d | ||
|
|
05fbbebca5 | ||
|
|
cdb0540cf0 | ||
|
|
832090d01c | ||
|
|
8e21aad444 | ||
|
|
31551aba9d | ||
|
|
dbcd56209a | ||
|
|
ce426cd957 | ||
|
|
1fe01eb0b1 | ||
|
|
24db198d52 | ||
|
|
b1921b362e | ||
|
|
35b73514b7 | ||
|
|
6322c329bf | ||
|
|
b6e19c5a45 | ||
|
|
871136bf91 | ||
|
|
94381733ff | ||
|
|
ca9027bc38 | ||
|
|
139abe73a1 | ||
|
|
097a3e9024 | ||
|
|
9e14f8d828 | ||
|
|
f797f92716 | ||
|
|
7f6eab8c25 | ||
|
|
b288f3ee59 | ||
|
|
b833c3f02a | ||
|
|
d53f1d8ff4 | ||
|
|
e259dd591f | ||
|
|
daf8d22e07 | ||
|
|
6249f596f9 | ||
|
|
6c1409ae57 | ||
|
|
0d9918cd24 | ||
|
|
bb093817ed | ||
|
|
1de0bb30b1 | ||
|
|
e429b6f745 | ||
|
|
e3a5895c2b | ||
|
|
5951712f2e | ||
|
|
85cb6d9476 | ||
|
|
5029bce65c | ||
|
|
697f468f36 | ||
|
|
9659dab19e | ||
|
|
398e34967f | ||
|
|
9833c7f1e6 | ||
|
|
266b23745b | ||
|
|
65f431ab78 | ||
|
|
5c2a8b9047 | ||
|
|
05abc2bab2 | ||
|
|
c916070300 | ||
|
|
f392f558e0 | ||
|
|
54d920165e | ||
|
|
c3868809df | ||
|
|
e768a1f228 | ||
|
|
217e740791 | ||
|
|
dc065dfa5a | ||
|
|
6a15e168ce | ||
|
|
7084258dd4 | ||
|
|
56c3507ef2 | ||
|
|
650b8e6777 | ||
|
|
7353fa88cd | ||
|
|
50864bcd08 | ||
|
|
e36d79706e | ||
|
|
342ef8e7e1 | ||
|
|
89d09922f7 | ||
|
|
339c30f48b | ||
|
|
6caad0a5f6 | ||
|
|
9d3195bec1 | ||
|
|
3ab4b22460 | ||
|
|
286da15a2c | ||
|
|
4d10825e7a | ||
|
|
ba9b3d4421 | ||
|
|
70bb34ed11 | ||
|
|
e480e29cfc | ||
|
|
2c3a9fd3c5 | ||
|
|
8322c61a0a | ||
|
|
6a058ed6cd | ||
|
|
2f6c4d8d24 | ||
|
|
afd288b660 | ||
|
|
5933cd11cd | ||
|
|
156dbd57ba | ||
|
|
04b6a162ea | ||
|
|
3e92b72aef | ||
|
|
3d139fc424 | ||
|
|
82664bfdcc | ||
|
|
ddccf79f2d | ||
|
|
920391a85d | ||
|
|
c7219bf9e3 | ||
|
|
a4410e20a8 | ||
|
|
d061a0cadf | ||
|
|
e87b0b565a | ||
|
|
16e7e26a2b | ||
|
|
e4fd9da529 | ||
|
|
c519ee59b2 | ||
|
|
da6235ff55 | ||
|
|
8903eecbb6 | ||
|
|
68dfa0440a | ||
|
|
931f4b8dec | ||
|
|
3e177536ba | ||
|
|
2633298855 | ||
|
|
f272c5fb98 | ||
|
|
9ab67cc2f6 | ||
|
|
8035effa1a | ||
|
|
038e261069 | ||
|
|
0d12131f50 | ||
|
|
993d3331fa | ||
|
|
5f78c626d1 | ||
|
|
2021c2e8e9 | ||
|
|
52bc1dc085 | ||
|
|
540d88f809 | ||
|
|
bd17a98386 | ||
|
|
ea76144fa1 | ||
|
|
9a879385c1 | ||
|
|
bd4d0ae2d3 | ||
|
|
fea722b621 | ||
|
|
b0ba1a2113 | ||
|
|
420e834a31 | ||
|
|
8edbefcfa3 | ||
|
|
e21c70a9e0 | ||
|
|
6b86fb4bbb | ||
|
|
81c184ffc1 | ||
|
|
31a753ff7a | ||
|
|
7ff3905120 | ||
|
|
18da367676 | ||
|
|
b029f38750 | ||
|
|
e4bcd82590 | ||
|
|
a3c6dd9767 | ||
|
|
c2540f555c | ||
|
|
a0500a5faa | ||
|
|
ebf09b587b | ||
|
|
41feba221d | ||
|
|
bd900fb10f | ||
|
|
ea3001dd39 | ||
|
|
7294c766ac | ||
|
|
fb9d3ec897 | ||
|
|
75cefdb527 | ||
|
|
9694e7593f | ||
|
|
8d41e6ea9b | ||
|
|
e282ff6e4a | ||
|
|
282ffa10e5 | ||
|
|
72d85e90ac | ||
|
|
2fc89a6b2c | ||
|
|
12bc4dc6c0 | ||
|
|
cdf508a734 | ||
|
|
1dd99250c3 | ||
|
|
d2cb956a75 | ||
|
|
004ca01049 | ||
|
|
ec4ffa99b6 | ||
|
|
844265303c | ||
|
|
aee588b650 | ||
|
|
8f51e8fb5d | ||
|
|
773777f209 | ||
|
|
9437dd3ea8 | ||
|
|
fb5ffd2876 | ||
|
|
2d36065a15 | ||
|
|
e19963b0ac | ||
|
|
9c631ea744 | ||
|
|
9ab77e77b1 | ||
|
|
eb56416cb5 | ||
|
|
703241e1e7 | ||
|
|
0a8ed258da | ||
|
|
7ef5402599 | ||
|
|
a799513b2e |
1
.circleci/.gitignore
vendored
1
.circleci/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
config-staging
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
version: 2.1
|
|
||||||
|
|
||||||
# Required for dynamic configuration
|
|
||||||
setup: true
|
|
||||||
|
|
||||||
# Orbs
|
|
||||||
orbs:
|
|
||||||
path-filtering: circleci/path-filtering@0.1.0
|
|
||||||
continuation: circleci/continuation@0.2.0
|
|
||||||
|
|
||||||
# All input parameters to pass to build config
|
|
||||||
parameters:
|
|
||||||
run-docs-only:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
upload-to-storage:
|
|
||||||
type: string
|
|
||||||
default: '1'
|
|
||||||
|
|
||||||
run-build-linux:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
run-build-mac:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
run-linux-publish:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
linux-publish-arch-limit:
|
|
||||||
type: enum
|
|
||||||
default: all
|
|
||||||
enum: ["all", "arm", "arm64", "x64", "ia32"]
|
|
||||||
|
|
||||||
run-macos-publish:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
macos-publish-arch-limit:
|
|
||||||
type: enum
|
|
||||||
default: all
|
|
||||||
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
generate-config:
|
|
||||||
docker:
|
|
||||||
- image: cimg/node:16.14
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- path-filtering/set-parameters:
|
|
||||||
base-revision: main
|
|
||||||
mapping: |
|
|
||||||
^((?!docs/).)*$ run-build-mac true
|
|
||||||
^((?!docs/).)*$ run-build-linux true
|
|
||||||
docs/.* run-docs-only true
|
|
||||||
^((?!docs/).)*$ run-docs-only false
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
cd .circleci/config
|
|
||||||
yarn
|
|
||||||
export CIRCLECI_BINARY="$HOME/circleci"
|
|
||||||
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | DESTDIR=$CIRCLECI_BINARY bash
|
|
||||||
node build.js
|
|
||||||
name: Pack config.yml
|
|
||||||
- run:
|
|
||||||
name: Set params
|
|
||||||
command: node .circleci/config/params.js
|
|
||||||
- continuation/continue:
|
|
||||||
configuration_path: .circleci/config-staging/built.yml
|
|
||||||
parameters: /tmp/pipeline-parameters.json
|
|
||||||
|
|
||||||
# Initial setup workflow
|
|
||||||
workflows:
|
|
||||||
setup:
|
|
||||||
jobs:
|
|
||||||
- generate-config
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,34 +0,0 @@
|
|||||||
const cp = require('child_process');
|
|
||||||
const fs = require('fs-extra');
|
|
||||||
const path = require('path');
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const STAGING_DIR = path.resolve(__dirname, '..', 'config-staging');
|
|
||||||
|
|
||||||
function copyAndExpand(dir = './') {
|
|
||||||
const absDir = path.resolve(__dirname, dir);
|
|
||||||
const targetDir = path.resolve(STAGING_DIR, dir);
|
|
||||||
|
|
||||||
if (!fs.existsSync(targetDir)) {
|
|
||||||
fs.mkdirSync(targetDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const file of fs.readdirSync(absDir)) {
|
|
||||||
if (!file.endsWith('.yml')) {
|
|
||||||
if (fs.statSync(path.resolve(absDir, file)).isDirectory()) {
|
|
||||||
copyAndExpand(path.join(dir, file));
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync(path.resolve(targetDir, file), yaml.dump(yaml.load(fs.readFileSync(path.resolve(absDir, file), 'utf8')), {
|
|
||||||
noRefs: true,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fs.pathExists(STAGING_DIR)) fs.removeSync(STAGING_DIR);
|
|
||||||
copyAndExpand();
|
|
||||||
|
|
||||||
const output = cp.spawnSync(process.env.CIRCLECI_BINARY || 'circleci', ['config', 'pack', STAGING_DIR]);
|
|
||||||
fs.writeFileSync(path.resolve(STAGING_DIR, 'built.yml'), output.stdout.toString());
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
executor:
|
|
||||||
name: linux-docker
|
|
||||||
size: medium
|
|
||||||
steps:
|
|
||||||
- checkout:
|
|
||||||
path: src/electron
|
|
||||||
- run:
|
|
||||||
name: Setup third_party Depot Tools
|
|
||||||
command: |
|
|
||||||
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
|
|
||||||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
|
|
||||||
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Download GN Binary
|
|
||||||
command: |
|
|
||||||
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
|
||||||
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
|
|
||||||
|
|
||||||
cipd ensure -ensure-file - -root . \<<-CIPD
|
|
||||||
\$ServiceURL https://chrome-infra-packages.appspot.com/
|
|
||||||
@Subdir src/buildtools/linux64
|
|
||||||
gn/gn/linux-amd64 $gn_version
|
|
||||||
CIPD
|
|
||||||
|
|
||||||
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Download clang-format Binary
|
|
||||||
command: |
|
|
||||||
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
|
||||||
|
|
||||||
sha1_path='buildtools/linux64/clang-format.sha1'
|
|
||||||
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
|
|
||||||
|
|
||||||
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
|
|
||||||
- run:
|
|
||||||
name: Run Lint
|
|
||||||
command: |
|
|
||||||
# gn.py tries to find a gclient root folder starting from the current dir.
|
|
||||||
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
|
|
||||||
touch .gclient
|
|
||||||
# Another option would be to checkout "buildtools" inside the Electron checkout,
|
|
||||||
# but then we would lint its contents (at least gn format), and it doesn't pass it.
|
|
||||||
|
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
node script/yarn lint
|
|
||||||
- run:
|
|
||||||
name: Run Script Typechecker
|
|
||||||
command: |
|
|
||||||
cd src/electron
|
|
||||||
node script/yarn tsc -p tsconfig.script.json
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@electron/circleci-config",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"private": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"fs-extra": "^10.1.0",
|
|
||||||
"js-yaml": "^4.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const PARAMS_PATH = '/tmp/pipeline-parameters.json';
|
|
||||||
|
|
||||||
const content = JSON.parse(fs.readFileSync(PARAMS_PATH, 'utf-8'));
|
|
||||||
|
|
||||||
// Choose resource class for linux hosts
|
|
||||||
const currentBranch = process.env.CIRCLE_BRANCH || '';
|
|
||||||
content['large-linux-executor'] = /^pull\/[0-9-]+$/.test(currentBranch) ? '2xlarge' : 'electronjs/aks-linux-large';
|
|
||||||
content['medium-linux-executor'] = /^pull\/[0-9-]+$/.test(currentBranch) ? 'medium' : 'electronjs/aks-linux-medium';
|
|
||||||
|
|
||||||
fs.writeFileSync(PARAMS_PATH, JSON.stringify(content));
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
argparse@^2.0.1:
|
|
||||||
version "2.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
|
||||||
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
|
|
||||||
|
|
||||||
fs-extra@^10.1.0:
|
|
||||||
version "10.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
|
|
||||||
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
|
|
||||||
dependencies:
|
|
||||||
graceful-fs "^4.2.0"
|
|
||||||
jsonfile "^6.0.1"
|
|
||||||
universalify "^2.0.0"
|
|
||||||
|
|
||||||
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
|
|
||||||
version "4.2.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
|
|
||||||
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
|
|
||||||
|
|
||||||
js-yaml@^4.1.0:
|
|
||||||
version "4.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
|
|
||||||
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
|
|
||||||
dependencies:
|
|
||||||
argparse "^2.0.1"
|
|
||||||
|
|
||||||
jsonfile@^6.0.1:
|
|
||||||
version "6.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
|
|
||||||
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
|
|
||||||
dependencies:
|
|
||||||
universalify "^2.0.0"
|
|
||||||
optionalDependencies:
|
|
||||||
graceful-fs "^4.1.6"
|
|
||||||
|
|
||||||
universalify@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
|
|
||||||
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
|
|
||||||
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
|
|
||||||
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts
|
|
||||||
@@ -27,7 +27,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": ["joeleinbinder.mojom-language",
|
"extensions": [
|
||||||
|
"joeleinbinder.mojom-language",
|
||||||
"rafaelmaiolla.diff",
|
"rafaelmaiolla.diff",
|
||||||
"surajbarkale.ninja",
|
"surajbarkale.ninja",
|
||||||
"ms-vscode.cpptools",
|
"ms-vscode.cpptools",
|
||||||
@@ -35,7 +36,6 @@
|
|||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"shakram02.bash-beautify",
|
"shakram02.bash-beautify",
|
||||||
"marshallofsound.gnls-electron",
|
"marshallofsound.gnls-electron",
|
||||||
"CircleCI.circleci"
|
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
buildtools:
|
buildtools:
|
||||||
image: ghcr.io/electron/devcontainer:3d8d44d0f15b05bef6149e448f9cc522111847e9
|
image: ghcr.io/electron/devcontainer:9a43c14f5c19be0359843299f79e736521373adc
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/workspaces/gclient/src/electron:cached
|
- ..:/workspaces/gclient/src/electron:cached
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
|
|||||||
write_config() {
|
write_config() {
|
||||||
echo "
|
echo "
|
||||||
{
|
{
|
||||||
\"goma\": \"$1\",
|
|
||||||
\"root\": \"/workspaces/gclient\",
|
\"root\": \"/workspaces/gclient\",
|
||||||
\"remotes\": {
|
\"remotes\": {
|
||||||
\"electron\": {
|
\"electron\": {
|
||||||
@@ -49,7 +48,7 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
|
|||||||
\"gen\": {
|
\"gen\": {
|
||||||
\"args\": [
|
\"args\": [
|
||||||
\"import(\\\"//electron/build/args/testing.gn\\\")\",
|
\"import(\\\"//electron/build/args/testing.gn\\\")\",
|
||||||
\"import(\\\"/home/builduser/.electron_build_tools/third_party/goma.gn\\\")\"
|
\"use_remoteexec = true\"
|
||||||
],
|
],
|
||||||
\"out\": \"Testing\"
|
\"out\": \"Testing\"
|
||||||
},
|
},
|
||||||
@@ -57,26 +56,18 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
|
|||||||
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
|
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
|
||||||
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
|
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
|
||||||
},
|
},
|
||||||
\"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\"
|
\"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\",
|
||||||
|
\"configValidationLevel\": \"strict\",
|
||||||
|
\"reclient\": \"$1\",
|
||||||
|
\"goma\": \"none\",
|
||||||
|
\"preserveXcode\": 5
|
||||||
}
|
}
|
||||||
" >$buildtools/configs/evm.testing.json
|
" >$buildtools/configs/evm.testing.json
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start out as cache only
|
write_config remote_exec
|
||||||
write_config cache-only
|
|
||||||
|
|
||||||
e use testing
|
e use testing
|
||||||
|
|
||||||
# Attempt to auth to the goma service via codespaces tokens
|
|
||||||
# if it works we can use the goma cluster
|
|
||||||
export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN
|
|
||||||
if e d goma_auth login; then
|
|
||||||
echo "$GITHUB_USER has GOMA access - switching to cluster mode"
|
|
||||||
write_config cluster
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "build-tools testing config already exists"
|
echo "build-tools testing config already exists"
|
||||||
|
|
||||||
# Re-auth with the goma cluster regardless.
|
|
||||||
NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,5 +2,4 @@
|
|||||||
# See docs/development/releasing.md
|
# See docs/development/releasing.md
|
||||||
|
|
||||||
APPVEYOR_CLOUD_TOKEN=
|
APPVEYOR_CLOUD_TOKEN=
|
||||||
CIRCLE_TOKEN=
|
|
||||||
ELECTRON_GITHUB_TOKEN=
|
ELECTRON_GITHUB_TOKEN=
|
||||||
|
|||||||
@@ -19,7 +19,40 @@
|
|||||||
"prefer-const": ["error", {
|
"prefer-const": ["error", {
|
||||||
"destructuring": "all"
|
"destructuring": "all"
|
||||||
}],
|
}],
|
||||||
"standard/no-callback-literal": "off"
|
"n/no-callback-literal": "off",
|
||||||
|
"import/newline-after-import": "error",
|
||||||
|
"import/order": ["error", {
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc"
|
||||||
|
},
|
||||||
|
"newlines-between": "always",
|
||||||
|
"pathGroups": [
|
||||||
|
{
|
||||||
|
"pattern": "@electron/internal/**",
|
||||||
|
"group": "external",
|
||||||
|
"position": "before"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pattern": "@electron/**",
|
||||||
|
"group": "external",
|
||||||
|
"position": "before"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pattern": "{electron,electron/**}",
|
||||||
|
"group": "external",
|
||||||
|
"position": "before"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pathGroupsExcludedImportTypes": [],
|
||||||
|
"distinctGroup": true,
|
||||||
|
"groups": [
|
||||||
|
"external",
|
||||||
|
"builtin",
|
||||||
|
["sibling", "parent"],
|
||||||
|
"index",
|
||||||
|
"type"
|
||||||
|
]
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 6,
|
"ecmaVersion": 6,
|
||||||
|
|||||||
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,6 +1,9 @@
|
|||||||
# `git apply` and friends don't understand CRLF, even on windows. Force those
|
# `git apply` and friends don't understand CRLF, even on windows. Force those
|
||||||
# files to be checked out with LF endings even if core.autocrlf is true.
|
# files to be checked out with LF endings even if core.autocrlf is true.
|
||||||
*.patch text eol=lf
|
*.patch text eol=lf
|
||||||
|
DEPS text eol=lf
|
||||||
|
yarn.lock text eol=lf
|
||||||
|
script/zip_manifests/*.manifest text eol=lf
|
||||||
patches/**/.patches merge=union
|
patches/**/.patches merge=union
|
||||||
|
|
||||||
# Source code and markdown files should always use LF as line ending.
|
# Source code and markdown files should always use LF as line ending.
|
||||||
@@ -22,6 +25,7 @@ patches/**/.patches merge=union
|
|||||||
*.md text eol=lf
|
*.md text eol=lf
|
||||||
*.mm text eol=lf
|
*.mm text eol=lf
|
||||||
*.mojom text eol=lf
|
*.mojom text eol=lf
|
||||||
|
*.patches text eol=lf
|
||||||
*.proto text eol=lf
|
*.proto text eol=lf
|
||||||
*.py text eol=lf
|
*.py text eol=lf
|
||||||
*.ps1 text eol=lf
|
*.ps1 text eol=lf
|
||||||
|
|||||||
228
.github/actions/build-electron/action.yml
vendored
Normal file
228
.github/actions/build-electron/action.yml
vendored
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
name: 'Build Electron'
|
||||||
|
description: 'Builds Electron & Friends'
|
||||||
|
inputs:
|
||||||
|
target-arch:
|
||||||
|
description: 'Target arch'
|
||||||
|
required: true
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
|
required: true
|
||||||
|
artifact-platform:
|
||||||
|
description: 'Artifact platform, should be linux, win, darwin or mas'
|
||||||
|
required: true
|
||||||
|
step-suffix:
|
||||||
|
description: 'Suffix for build steps'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
is-release:
|
||||||
|
description: 'Is release build'
|
||||||
|
required: true
|
||||||
|
strip-binaries:
|
||||||
|
description: 'Strip binaries (Linux only)'
|
||||||
|
required: false
|
||||||
|
generate-symbols:
|
||||||
|
description: 'Generate symbols'
|
||||||
|
required: true
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Upload to storage'
|
||||||
|
required: true
|
||||||
|
is-asan:
|
||||||
|
description: 'The ASan Linux build'
|
||||||
|
required: false
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set GN_EXTRA_ARGS for MacOS x64 Builds
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.target-arch == 'x64' && inputs.target-platform == 'macos' }}
|
||||||
|
run: |
|
||||||
|
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"x64\" v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
|
||||||
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Build Electron ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
rm -rf "src/out/Default/Electron Framework.framework"
|
||||||
|
rm -rf src/out/Default/Electron*.app
|
||||||
|
|
||||||
|
cd src/electron
|
||||||
|
# TODO(codebytere): remove this once we figure out why .git/packed-refs is initially missing
|
||||||
|
git pack-refs
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
if [ "`uname`" = "Darwin" ]; then
|
||||||
|
ulimit -n 10000
|
||||||
|
sudo launchctl limit maxfiles 65536 200000
|
||||||
|
fi
|
||||||
|
|
||||||
|
NINJA_SUMMARIZE_BUILD=1 e build -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
cp out/Default/.ninja_log out/electron_ninja_log
|
||||||
|
node electron/script/check-symlinks.js
|
||||||
|
- name: Strip Electron Binaries ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.strip-binaries == 'true' }}
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
electron/script/copy-debug-symbols.py --target-cpu="${{ inputs.target-arch }}" --out-dir=out/Default/debug --compress
|
||||||
|
electron/script/strip-binaries.py --target-cpu="${{ inputs.target-arch }}"
|
||||||
|
electron/script/add-debug-link.py --target-cpu="${{ inputs.target-arch }}" --debug-dir=out/Default/debug
|
||||||
|
- name: Build Electron dist.zip ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
||||||
|
target_os=${{ inputs.target-platform == 'macos' && 'mac' || inputs.target-platform }}
|
||||||
|
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||||
|
target_os="${target_os}_mas"
|
||||||
|
fi
|
||||||
|
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.${{ inputs.target-arch }}.manifest
|
||||||
|
fi
|
||||||
|
- name: Build Mksnapshot ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||||
|
# Remove unused args from mksnapshot_args
|
||||||
|
SEDOPTION="-i"
|
||||||
|
if [ "`uname`" = "Darwin" ]; then
|
||||||
|
SEDOPTION="-i ''"
|
||||||
|
fi
|
||||||
|
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||||
|
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||||
|
sed $SEDOPTION '/The gn arg use_goma=true .*/d' out/Default/mksnapshot_args
|
||||||
|
|
||||||
|
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||||
|
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
||||||
|
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/v8_context_snapshot_generator
|
||||||
|
else
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
|
||||||
|
electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
cd out/Default
|
||||||
|
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
|
||||||
|
powershell Compress-Archive -update gen/v8/embedded.S mksnapshot.zip
|
||||||
|
else
|
||||||
|
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
||||||
|
fi
|
||||||
|
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||||
|
MKSNAPSHOT_PATH="clang_x86_v8_arm"
|
||||||
|
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||||
|
MKSNAPSHOT_PATH="clang_x64_v8_arm64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
|
||||||
|
cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
|
||||||
|
cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
|
||||||
|
|
||||||
|
python3 electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
|
||||||
|
mkdir cross-arch-snapshots
|
||||||
|
cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
|
||||||
|
# Clean up so that ninja does not get confused
|
||||||
|
rm -f out/Default/libffmpeg.so
|
||||||
|
- name: Build Chromedriver ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
e build --target electron:electron_chromedriver_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
- name: Setup to clear out reproxy_tmp
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1
|
||||||
|
- name: Build Node.js headers ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
e build --target electron:node_headers
|
||||||
|
- name: Generate & Zip Symbols ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Generate breakpad symbols on release builds
|
||||||
|
if [ "${{ inputs.generate-symbols }}" = "true" ]; then
|
||||||
|
e build --target electron:electron_symbols
|
||||||
|
fi
|
||||||
|
cd src
|
||||||
|
export BUILD_PATH="$(pwd)/out/Default"
|
||||||
|
e build --target electron:licenses
|
||||||
|
e build --target electron:electron_version_file
|
||||||
|
if [ "${{ inputs.is-release }}" = "true" ]; then
|
||||||
|
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
|
||||||
|
else
|
||||||
|
electron/script/zip-symbols.py -b $BUILD_PATH
|
||||||
|
fi
|
||||||
|
- name: Generate FFMpeg ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.is-release == 'true' }}
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
|
||||||
|
e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
- name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
|
||||||
|
run: |
|
||||||
|
e build --target electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
- name: Generate Libcxx ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
|
||||||
|
run: |
|
||||||
|
e build --target electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
e build --target electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
e build --target electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
- name: Generate TypeScript Definitions ${{ inputs.step-suffix }}
|
||||||
|
if: ${{ inputs.is-release == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn create-typescript-definitions
|
||||||
|
- name: Publish Electron Dist ${{ inputs.step-suffix }}
|
||||||
|
if: ${{ inputs.is-release == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
rm -rf src/out/Default/obj
|
||||||
|
cd src/electron
|
||||||
|
if [ "${{ inputs.upload-to-storage }}" = "1" ]; then
|
||||||
|
echo 'Uploading Electron release distribution to Azure'
|
||||||
|
script/release/uploaders/upload.py --verbose --upload_to_storage
|
||||||
|
else
|
||||||
|
echo 'Uploading Electron release distribution to GitHub releases'
|
||||||
|
script/release/uploaders/upload.py --verbose
|
||||||
|
fi
|
||||||
|
- name: Generate Artifact Key
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.is-asan }}" = "true" ]; then
|
||||||
|
ARTIFACT_KEY=${{ inputs.artifact-platform }}_${{ inputs.target-arch }}_asan
|
||||||
|
else
|
||||||
|
ARTIFACT_KEY=${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
|
||||||
|
fi
|
||||||
|
echo "ARTIFACT_KEY=$ARTIFACT_KEY" >> $GITHUB_ENV
|
||||||
|
# The current generated_artifacts_<< artifact.key >> name was taken from CircleCI
|
||||||
|
# to ensure we don't break anything, but we may be able to improve that.
|
||||||
|
- name: Move all Generated Artifacts to Upload Folder ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
run: ./src/electron/script/actions/move-artifacts.sh
|
||||||
|
- name: Upload Generated Artifacts ${{ inputs.step-suffix }}
|
||||||
|
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
||||||
|
with:
|
||||||
|
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
|
path: ./generated_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
|
||||||
|
- name: Upload Src Artifacts ${{ inputs.step-suffix }}
|
||||||
|
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
||||||
|
with:
|
||||||
|
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
|
path: ./src_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
|
||||||
183
.github/actions/checkout/action.yml
vendored
Normal file
183
.github/actions/checkout/action.yml
vendored
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
name: 'Checkout'
|
||||||
|
description: 'Checks out Electron and stores it in the AKS Cache'
|
||||||
|
inputs:
|
||||||
|
generate-sas-token:
|
||||||
|
description: 'Whether to generate and persist a SAS token for the item in the cache'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
use-cache:
|
||||||
|
description: 'Whether to persist the cache to the shared drive'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set GIT_CACHE_PATH to make gclient to use the cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Install Build Tools
|
||||||
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
- name: Get Depot Tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ ! -d depot_tools ]]; then
|
||||||
|
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
test -d depot_tools && cd depot_tools
|
||||||
|
git fetch --depth 1 origin 31e21628c3a558d4f2189712e25849d608b3ff8c
|
||||||
|
git checkout 31e21628c3a558d4f2189712e25849d608b3ff8c
|
||||||
|
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
||||||
|
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
||||||
|
# Ensure depot_tools does not update.
|
||||||
|
touch .disable_auto_update
|
||||||
|
echo "DEPOT_TOOLS_DIR=$(pwd)" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
- name: Add Depot Tools to PATH
|
||||||
|
shell: bash
|
||||||
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Generate DEPS Hash
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
node src/electron/script/generate-deps-hash.js
|
||||||
|
echo "DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||||
|
- name: Generate SAS Key
|
||||||
|
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$DEPSHASH.tar" > sas-token
|
||||||
|
- name: Save SAS Key
|
||||||
|
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
sas-token
|
||||||
|
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
|
- name: Check If Cache Exists
|
||||||
|
id: check-cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ inputs.use-cache }}" == "false" ]]; then
|
||||||
|
echo "Not using cache this time..."
|
||||||
|
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||||
|
echo "Using cache key: $DEPSHASH"
|
||||||
|
echo "Checking for cache in: $cache_path"
|
||||||
|
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||||
|
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "Cache Does Not Exist for $DEPSHASH"
|
||||||
|
else
|
||||||
|
echo "cache_exists=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Cache Already Exists for $DEPSHASH, Skipping.."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
- name: Check cross instance cache disk space
|
||||||
|
if: steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# if there is less than 20 GB free space then creating the cache might fail so exit early
|
||||||
|
freespace=`df -m /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||||
|
freespace_human=`df -h /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||||
|
if [ $freespace -le 20000 ]; then
|
||||||
|
echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "The cross mount cache has $freespace_human free space - continuing"
|
||||||
|
fi
|
||||||
|
- name: Gclient Sync
|
||||||
|
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
e d gclient config \
|
||||||
|
--name "src/electron" \
|
||||||
|
--unmanaged \
|
||||||
|
${GCLIENT_EXTRA_ARGS} \
|
||||||
|
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
||||||
|
|
||||||
|
if [ "$TARGET_OS" != "" ]; then
|
||||||
|
echo "target_os=['$TARGET_OS']" >> ./.gclient
|
||||||
|
fi
|
||||||
|
|
||||||
|
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
|
||||||
|
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
|
||||||
|
# Re-export all the patches to check if there were changes.
|
||||||
|
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||||
|
cd src/electron
|
||||||
|
git update-index --refresh || true
|
||||||
|
if ! git diff-index --quiet HEAD --; then
|
||||||
|
# There are changes to the patches. Make a git commit with the updated patches
|
||||||
|
git add patches
|
||||||
|
GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
|
||||||
|
# Export it
|
||||||
|
mkdir -p ../../patches
|
||||||
|
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
|
||||||
|
if (node ./script/push-patch.js 2> /dev/null > /dev/null); then
|
||||||
|
echo
|
||||||
|
echo "======================================================================"
|
||||||
|
echo "Changes to the patches when applying, we have auto-pushed the diff to the current branch"
|
||||||
|
echo "A new CI job will kick off shortly"
|
||||||
|
echo "======================================================================"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "======================================================================"
|
||||||
|
echo "There were changes to the patches when applying."
|
||||||
|
echo "Check the CI artifacts for a patch you can apply to fix it."
|
||||||
|
echo "======================================================================"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# delete all .git directories under src/ except for
|
||||||
|
# third_party/angle/ and third_party/dawn/ because of build time generation of files
|
||||||
|
# gen/angle/commit.h depends on third_party/angle/.git/HEAD
|
||||||
|
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
||||||
|
# and dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
|
||||||
|
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
||||||
|
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
|
||||||
|
- name: Delete .git directories under src to free space
|
||||||
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
|
||||||
|
- name: Minimize Cache Size for Upload
|
||||||
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
rm -rf src/android_webview
|
||||||
|
rm -rf src/ios/chrome
|
||||||
|
rm -rf src/third_party/blink/web_tests
|
||||||
|
rm -rf src/third_party/blink/perf_tests
|
||||||
|
rm -rf src/chrome/test/data/xr/webvr_info
|
||||||
|
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
|
||||||
|
rm -rf src/third_party/swift-toolchain
|
||||||
|
rm -rf src/third_party/swiftshader/tests/regres/testlists
|
||||||
|
cp src/electron/.github/actions/checkout/action.yml ./
|
||||||
|
rm -rf src/electron
|
||||||
|
mkdir -p src/electron/.github/actions/checkout
|
||||||
|
mv action.yml src/electron/.github/actions/checkout
|
||||||
|
- name: Compress Src Directory
|
||||||
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
||||||
|
tar -cf $DEPSHASH.tar src
|
||||||
|
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
|
||||||
|
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
|
||||||
|
- name: Persist Src Cache
|
||||||
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||||
|
echo "Using cache key: $DEPSHASH"
|
||||||
|
echo "Checking path: $final_cache_path"
|
||||||
|
if [ ! -f "$final_cache_path" ]; then
|
||||||
|
echo "Cache key not found"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Cache key persisted in $final_cache_path"
|
||||||
|
fi
|
||||||
61
.github/actions/fix-sync-macos/action.yml
vendored
Normal file
61
.github/actions/fix-sync-macos/action.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: 'Fix Sync macOS'
|
||||||
|
description: 'Checks out Electron and stores it in the AKS Cache'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Fix Sync
|
||||||
|
shell: bash
|
||||||
|
# This step is required to correct for differences between "gclient sync"
|
||||||
|
# on Linux and the expected state on macOS. This requires:
|
||||||
|
# 1. Fixing Clang Install (wrong binary)
|
||||||
|
# 2. Fixing esbuild (wrong binary)
|
||||||
|
# 3. Fixing rustc (wrong binary)
|
||||||
|
# 4. Fixing gn (wrong binary)
|
||||||
|
# 5. Fix reclient (wrong binary)
|
||||||
|
# 6. Fixing dsymutil (wrong binary)
|
||||||
|
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||||
|
# 8. Fixing angle (wrong remote)
|
||||||
|
run : |
|
||||||
|
SEDOPTION="-i ''"
|
||||||
|
rm -rf src/third_party/llvm-build
|
||||||
|
python3 src/tools/clang/scripts/update.py
|
||||||
|
|
||||||
|
echo 'infra/3pp/tools/esbuild/${platform}' `gclient getdep --deps-file=src/third_party/devtools-frontend/src/DEPS -r 'third_party/esbuild:infra/3pp/tools/esbuild/${platform}'` > esbuild_ensure_file
|
||||||
|
# Remove extra output from calling gclient getdep which always calls update_depot_tools
|
||||||
|
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
|
||||||
|
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
|
||||||
|
|
||||||
|
rm -rf src/third_party/rust-toolchain
|
||||||
|
python3 src/tools/rust/update_rust.py
|
||||||
|
|
||||||
|
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||||
|
echo 'gn/gn/mac-${arch}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/mac:gn/gn/mac-${arch}'` > gn_ensure_file
|
||||||
|
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||||
|
cipd ensure --root src/buildtools/mac -ensure-file gn_ensure_file
|
||||||
|
|
||||||
|
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||||
|
echo 'infra/rbe/client/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/reclient:infra/rbe/client/${platform}'` > gn_ensure_file
|
||||||
|
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||||
|
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
|
||||||
|
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||||
|
|
||||||
|
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||||
|
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||||
|
else
|
||||||
|
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||||
|
fi
|
||||||
|
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||||
|
|
||||||
|
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
||||||
|
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
|
||||||
|
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
||||||
|
|
||||||
|
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
cd src/third_party/angle
|
||||||
|
rm -f .git/objects/info/alternates
|
||||||
|
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||||
|
cp .git/config .git/config.backup
|
||||||
|
git remote remove origin
|
||||||
|
mv .git/config.backup .git/config
|
||||||
|
git fetch
|
||||||
65
.github/actions/free-space-macos/action.yml
vendored
Normal file
65
.github/actions/free-space-macos/action.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: 'Free Space macOS'
|
||||||
|
description: 'Checks out Electron and stores it in the AKS Cache'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Free Space on MacOS
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $TMPDIR/del-target
|
||||||
|
|
||||||
|
tmpify() {
|
||||||
|
if [ -d "$1" ]; then
|
||||||
|
sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
strip_universal_deep() {
|
||||||
|
opwd=$(pwd)
|
||||||
|
cd $1
|
||||||
|
f=$(find . -perm +111 -type f)
|
||||||
|
for fp in $f
|
||||||
|
do
|
||||||
|
if [[ $(file "$fp") == *"universal binary"* ]]; then
|
||||||
|
if [ "`arch`" == "arm64" ]; then
|
||||||
|
if [[ $(file "$fp") == *"x86_64"* ]]; then
|
||||||
|
sudo lipo -remove x86_64 "$fp" -o "$fp" || true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ $(file "$fp") == *"arm64e)"* ]]; then
|
||||||
|
sudo lipo -remove arm64e "$fp" -o "$fp" || true
|
||||||
|
fi
|
||||||
|
if [[ $(file "$fp") == *"arm64)"* ]]; then
|
||||||
|
sudo lipo -remove arm64 "$fp" -o "$fp" || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cd $opwd
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpify /Library/Developer/CoreSimulator
|
||||||
|
tmpify ~/Library/Developer/CoreSimulator
|
||||||
|
tmpify $(xcode-select -p)/Platforms/AppleTVOS.platform
|
||||||
|
tmpify $(xcode-select -p)/Platforms/iPhoneOS.platform
|
||||||
|
tmpify $(xcode-select -p)/Platforms/WatchOS.platform
|
||||||
|
tmpify $(xcode-select -p)/Platforms/WatchSimulator.platform
|
||||||
|
tmpify $(xcode-select -p)/Platforms/AppleTVSimulator.platform
|
||||||
|
tmpify $(xcode-select -p)/Platforms/iPhoneSimulator.platform
|
||||||
|
tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios
|
||||||
|
tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
|
||||||
|
tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0
|
||||||
|
tmpify ~/.rubies
|
||||||
|
tmpify ~/Library/Caches/Homebrew
|
||||||
|
tmpify /usr/local/Homebrew
|
||||||
|
|
||||||
|
sudo rm -rf $TMPDIR/del-target
|
||||||
|
|
||||||
|
sudo rm -rf /Applications/Safari.app
|
||||||
|
sudo rm -rf ~/project/src/third_party/catapult/tracing/test_data
|
||||||
|
sudo rm -rf ~/project/src/third_party/angle/third_party/VK-GL-CTS
|
||||||
|
|
||||||
|
# lipo off some huge binaries arm64 versions to save space
|
||||||
|
strip_universal_deep $(xcode-select -p)/../SharedFrameworks
|
||||||
|
# strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
|
||||||
24
.github/actions/generate-types/action.yml
vendored
Normal file
24
.github/actions/generate-types/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: 'Generate Types for Archaeologist Dig'
|
||||||
|
description: 'Generate Types for Archaeologist Dig'
|
||||||
|
inputs:
|
||||||
|
sha-file:
|
||||||
|
description: 'File containing sha'
|
||||||
|
required: true
|
||||||
|
filename:
|
||||||
|
description: 'Filename to write types to'
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Generating Types for SHA in ${{ inputs.sha-file }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git checkout $(cat ${{ inputs.sha-file }})
|
||||||
|
rm -rf node_modules
|
||||||
|
yarn install --frozen-lockfile --ignore-scripts
|
||||||
|
echo "#!/usr/bin/env node\nglobal.x=1" > node_modules/typescript/bin/tsc
|
||||||
|
node node_modules/.bin/electron-docs-parser --dir=./ --outDir=./ --moduleVersion=0.0.0-development
|
||||||
|
node node_modules/.bin/electron-typescript-definitions --api=electron-api.json --outDir=artifacts
|
||||||
|
mv artifacts/electron.d.ts artifacts/${{ inputs.filename }}
|
||||||
|
git checkout .
|
||||||
|
working-directory: ./electron
|
||||||
20
.github/actions/install-build-tools/action.yml
vendored
Normal file
20
.github/actions/install-build-tools/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: 'Install Build Tools'
|
||||||
|
description: 'Installs an exact SHA of build tools'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install Build Tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||||
|
git config --global core.filemode false
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global branch.autosetuprebase always
|
||||||
|
fi
|
||||||
|
export BUILD_TOOLS_SHA=8246e57791b0af4ae5975eb96f09855f9269b1cd
|
||||||
|
npm i -g @electron/build-tools
|
||||||
|
e auto-update disable
|
||||||
|
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||||
|
e d cipd.bat --version
|
||||||
|
cp "C:\Python37\python.exe" "C:\Python37\python3.exe"
|
||||||
|
fi
|
||||||
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: 'Install Dependencies'
|
||||||
|
description: 'Installs yarn depdencies using cache when available'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Get yarn cache directory path
|
||||||
|
shell: bash
|
||||||
|
id: yarn-cache-dir-path
|
||||||
|
run: echo "dir=$(node src/electron/script/yarn cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('src/electron/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- name: Install Dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn install --frozen-lockfile --prefer-offline
|
||||||
41
.github/actions/restore-cache-aks/action.yml
vendored
Normal file
41
.github/actions/restore-cache-aks/action.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: 'Restore Cache AKS'
|
||||||
|
description: 'Restores Electron src cache via AKS'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Restore and Ensure Src Cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||||
|
echo "Using cache key: $DEPSHASH"
|
||||||
|
echo "Checking for cache in: $cache_path"
|
||||||
|
if [ ! -f "$cache_path" ]; then
|
||||||
|
echo "Cache Does Not Exist for $DEPSHASH - exiting"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Found Cache for $DEPSHASH at $cache_path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Persisted cache is $(du -sh $cache_path | cut -f1)"
|
||||||
|
if [ `du $cache_path | cut -f1` = "0" ]; then
|
||||||
|
echo "Cache is empty - exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir temp-cache
|
||||||
|
tar -xf $cache_path -C temp-cache
|
||||||
|
echo "Unzipped cache is $(du -sh temp-cache/src | cut -f1)"
|
||||||
|
|
||||||
|
if [ -d "temp-cache/src" ]; then
|
||||||
|
echo "Relocating Cache"
|
||||||
|
rm -rf src
|
||||||
|
mv temp-cache/src src
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "src/third_party/blink" ]; then
|
||||||
|
echo "Cache was not correctly restored - exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Wiping Electron Directory"
|
||||||
|
rm -rf src/electron
|
||||||
71
.github/actions/restore-cache-azcopy/action.yml
vendored
Normal file
71
.github/actions/restore-cache-azcopy/action.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
name: 'Restore Cache AZCopy'
|
||||||
|
description: 'Restores Electron src cache via AZCopy'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Obtain SAS Key
|
||||||
|
continue-on-error: true
|
||||||
|
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
sas-token
|
||||||
|
key: sas-key-${{ github.run_number }}-1
|
||||||
|
- name: Obtain SAS Key
|
||||||
|
continue-on-error: true
|
||||||
|
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
sas-token
|
||||||
|
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
|
- name: Download Src Cache from AKS
|
||||||
|
# The cache will always exist here as a result of the checkout job
|
||||||
|
# Either it was uploaded to Azure in the checkout job for this commit
|
||||||
|
# or it was uploaded in the checkout job for a previous commit.
|
||||||
|
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
|
||||||
|
with:
|
||||||
|
timeout_minutes: 30
|
||||||
|
max_attempts: 3
|
||||||
|
retry_on: error
|
||||||
|
command: |
|
||||||
|
sas_token=$(cat sas-token)
|
||||||
|
if [ -z $sas-token ]; then
|
||||||
|
echo "SAS Token not found; exiting src cache download early..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
azcopy copy --log-level=ERROR \
|
||||||
|
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||||
|
env:
|
||||||
|
AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
|
||||||
|
AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
|
||||||
|
- name: Clean SAS Key
|
||||||
|
shell: bash
|
||||||
|
run: rm -f sas-token
|
||||||
|
- name: Unzip and Ensure Src Cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
|
||||||
|
if [ `du $DEPSHASH.tar | cut -f1` = "0" ]; then
|
||||||
|
echo "Cache is empty - exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir temp-cache
|
||||||
|
tar -xf $DEPSHASH.tar -C temp-cache
|
||||||
|
echo "Unzipped cache is $(du -sh temp-cache/src | cut -f1)"
|
||||||
|
|
||||||
|
if [ -d "temp-cache/src" ]; then
|
||||||
|
echo "Relocating Cache"
|
||||||
|
rm -rf src
|
||||||
|
mv temp-cache/src src
|
||||||
|
|
||||||
|
echo "Deleting zip file"
|
||||||
|
rm -rf $DEPSHASH.tar
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "src/third_party/blink" ]; then
|
||||||
|
echo "Cache was not correctly restored - exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Wiping Electron Directory"
|
||||||
|
rm -rf src/electron
|
||||||
61
.github/workflows/archaeologist-dig.yml
vendored
Normal file
61
.github/workflows/archaeologist-dig.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Archaeologist
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
archaeologist-dig:
|
||||||
|
name: Archaeologist Dig
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.0.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setting Up Dig Site
|
||||||
|
run: |
|
||||||
|
echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
|
||||||
|
echo "sha ${{ github.event.pull_request.head.sha }}"
|
||||||
|
echo "base ref ${{ github.event.pull_request.base.ref }}"
|
||||||
|
git clone https://github.com/electron/electron.git electron
|
||||||
|
cd electron
|
||||||
|
mkdir -p artifacts
|
||||||
|
git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} && git fetch fork
|
||||||
|
git checkout ${{ github.event.pull_request.head.sha }}
|
||||||
|
git merge-base origin/${{ github.event.pull_request.base.ref }} HEAD > .dig-old
|
||||||
|
echo ${{ github.event.pull_request.head.sha }} > .dig-new
|
||||||
|
cp .dig-old artifacts
|
||||||
|
|
||||||
|
- name: Generating Types for SHA in .dig-new
|
||||||
|
uses: ./.github/actions/generate-types
|
||||||
|
with:
|
||||||
|
sha-file: .dig-new
|
||||||
|
filename: electron.new.d.ts
|
||||||
|
- name: Generating Types for SHA in .dig-old
|
||||||
|
uses: ./.github/actions/generate-types
|
||||||
|
with:
|
||||||
|
sha-file: .dig-old
|
||||||
|
filename: electron.old.d.ts
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 #v4.4.0
|
||||||
|
with:
|
||||||
|
name: artifacts
|
||||||
|
path: electron/artifacts
|
||||||
|
include-hidden-files: true
|
||||||
|
- name: Set job output
|
||||||
|
run: |
|
||||||
|
git diff --no-index electron.old.d.ts electron.new.d.ts > patchfile || true
|
||||||
|
if [ -s patchfile ]; then
|
||||||
|
echo "Changes Detected"
|
||||||
|
echo "## Changes Detected" > $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Looks like the \`electron.d.ts\` file changed." >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "\`\`\`\`\`\`diff" >> $GITHUB_STEP_SUMMARY
|
||||||
|
cat patchfile >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "\`\`\`\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "No Changes Detected"
|
||||||
|
echo "## No Changes" > $GITHUB_STEP_SUMMARY
|
||||||
|
echo "We couldn't see any changes in the \`electron.d.ts\` artifact" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
working-directory: ./electron/artifacts
|
||||||
6
.github/workflows/branch-created.yml
vendored
6
.github/workflows/branch-created.yml
vendored
@@ -92,7 +92,7 @@ jobs:
|
|||||||
}))
|
}))
|
||||||
- name: Create Release Project Board
|
- name: Create Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||||
uses: dsanders11/project-actions/copy-project@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/copy-project@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
id: create-release-board
|
id: create-release-board
|
||||||
with:
|
with:
|
||||||
drafts: true
|
drafts: true
|
||||||
@@ -112,14 +112,14 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
- name: Find Previous Release Project Board
|
- name: Find Previous Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||||
uses: dsanders11/project-actions/find-project@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/find-project@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
id: find-prev-release-board
|
id: find-prev-release-board
|
||||||
with:
|
with:
|
||||||
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
- name: Close Previous Release Project Board
|
- name: Close Previous Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||||
uses: dsanders11/project-actions/close-project@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/close-project@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|||||||
384
.github/workflows/build.yml
vendored
Normal file
384
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build-image-sha:
|
||||||
|
type: string
|
||||||
|
description: 'SHA for electron/build image'
|
||||||
|
default: 'cf814a4d2501e8e843caea071a6b70a48e78b855'
|
||||||
|
required: true
|
||||||
|
skip-macos:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip macOS builds'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
skip-linux:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip Linux builds'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
skip-windows:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip Windows builds'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
skip-lint:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip lint check'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- '[1-9][0-9]-x-y'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
setup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
docs: ${{ steps.filter.outputs.docs }}
|
||||||
|
src: ${{ steps.filter.outputs.src }}
|
||||||
|
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
|
||||||
|
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
docs:
|
||||||
|
- 'docs/**'
|
||||||
|
src:
|
||||||
|
- '!docs/**'
|
||||||
|
- name: Set Outputs for Build Image SHA & Docs Only
|
||||||
|
id: set-output
|
||||||
|
run: |
|
||||||
|
if [ -z "${{ inputs.build-image-sha }}" ]; then
|
||||||
|
echo "build-image-sha=cf814a4d2501e8e843caea071a6b70a48e78b855" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
echo "docs-only=${{ steps.filter.outputs.docs == 'true' && steps.filter.outputs.src == 'false' }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Lint Jobs
|
||||||
|
lint:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ !inputs.skip-lint }}
|
||||||
|
uses: ./.github/workflows/pipeline-electron-lint.yml
|
||||||
|
with:
|
||||||
|
container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root"}'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Docs Only Jobs
|
||||||
|
docs-only:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.docs-only == 'true' }}
|
||||||
|
uses: ./.github/workflows/pipeline-electron-docs-only.yml
|
||||||
|
with:
|
||||||
|
container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root"}'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Checkout Jobs
|
||||||
|
checkout-macos:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-macos}}
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||||
|
options: --user root
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||||
|
outputs:
|
||||||
|
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
with:
|
||||||
|
generate-sas-token: 'true'
|
||||||
|
|
||||||
|
checkout-linux:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-linux}}
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||||
|
options: --user root
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||||
|
PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }}
|
||||||
|
outputs:
|
||||||
|
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
|
||||||
|
checkout-windows:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||||
|
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||||
|
TARGET_OS: 'win'
|
||||||
|
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||||
|
outputs:
|
||||||
|
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
|
||||||
|
# GN Check Jobs
|
||||||
|
macos-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
target-platform: macos
|
||||||
|
target-archs: x64 arm64
|
||||||
|
check-runs-on: macos-14
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
target-platform: linux
|
||||||
|
target-archs: x64 arm arm64
|
||||||
|
check-runs-on: electron-arc-linux-amd64-8core
|
||||||
|
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
target-platform: win
|
||||||
|
target-archs: x64 x86 arm64
|
||||||
|
check-runs-on: electron-arc-linux-amd64-8core
|
||||||
|
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Build Jobs - These cascade into testing jobs
|
||||||
|
macos-x64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
test-runs-on: macos-13
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
macos-arm64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
test-runs-on: macos-14
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-x64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test-and-nan.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
test-runs-on: electron-arc-linux-amd64-4core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-x64-asan:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
test-runs-on: electron-arc-linux-amd64-4core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
is-asan: true
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-arm:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
test-runs-on: electron-arc-linux-arm64-4core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: arm
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-arm64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
test-runs-on: electron-arc-linux-arm64-4core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-x64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: windows-latest
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-x86:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: windows-latest
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x86
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-arm64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: electron-hosted-windows-arm64-4core
|
||||||
|
target-platform: win
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
gha-done:
|
||||||
|
name: GitHub Actions Completed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
|
||||||
|
if: always() && !contains(needs.*.result, 'failure')
|
||||||
|
steps:
|
||||||
|
- name: GitHub Actions Jobs Done
|
||||||
|
run: |
|
||||||
|
echo "All GitHub Actions Jobs are done"
|
||||||
21
.github/workflows/clean-src-cache.yml
vendored
Normal file
21
.github/workflows/clean-src-cache.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Clean Source Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * SUN" # Run at midnight every Sunday
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clean-src-cache:
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
|
||||||
|
options: --user root
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
steps:
|
||||||
|
- name: Cleanup Source Cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
df -h /mnt/cross-instance-cache
|
||||||
|
find /mnt/cross-instance-cache -type f -mtime +30 -delete
|
||||||
|
df -h /mnt/cross-instance-cache
|
||||||
13
.github/workflows/config/gclient.diff
vendored
Normal file
13
.github/workflows/config/gclient.diff
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/gclient.py b/gclient.py
|
||||||
|
index 4042ac8311f12db41e74a85ba5fb0c43c61a108a..04159b681f9f0a3d580c8737d4abbcd7a4b02b42 100755
|
||||||
|
--- a/gclient.py
|
||||||
|
+++ b/gclient.py
|
||||||
|
@@ -784,6 +784,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
|
||||||
|
continue
|
||||||
|
cipd_root = self.GetCipdRoot()
|
||||||
|
for package in dep_value.get('packages', []):
|
||||||
|
+ if "infra/3pp/tools/swift-format" in package.get('package'):
|
||||||
|
+ continue
|
||||||
|
deps_to_add.append(
|
||||||
|
CipdDependency(parent=self,
|
||||||
|
name=name,
|
||||||
6
.github/workflows/issue-labeled.yml
vendored
6
.github/workflows/issue-labeled.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/edit-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/edit-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
- name: Create comment
|
- name: Create comment
|
||||||
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
|
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
|
||||||
uses: actions-cool/issues-helper@275328970dbc3bfc3bc43f5fe741bf3638300c0a # v3.3.3
|
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
|
||||||
with:
|
with:
|
||||||
actions: 'create-comment'
|
actions: 'create-comment'
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|||||||
2
.github/workflows/issue-opened.yml
vendored
2
.github/workflows/issue-opened.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Add to Issue Triage
|
- name: Add to Issue Triage
|
||||||
uses: dsanders11/project-actions/add-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/add-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
field: Reporter
|
field: Reporter
|
||||||
field-value: ${{ github.event.issue.user.login }}
|
field-value: ${{ github.event.issue.user.login }}
|
||||||
|
|||||||
2
.github/workflows/issue-unlabeled.yml
vendored
2
.github/workflows/issue-unlabeled.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
||||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/edit-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
|
|||||||
86
.github/workflows/linux-publish.yml
vendored
Normal file
86
.github/workflows/linux-publish.yml
vendored
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
name: Publish Linux
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build-image-sha:
|
||||||
|
type: string
|
||||||
|
description: 'SHA for electron/build image'
|
||||||
|
default: 'cf814a4d2501e8e843caea071a6b70a48e78b855'
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Uploads to Azure storage'
|
||||||
|
required: false
|
||||||
|
default: '1'
|
||||||
|
type: string
|
||||||
|
run-linux-publish:
|
||||||
|
description: 'Run the publish jobs vs just the build jobs'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkout-linux:
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
|
options: --user root
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
|
||||||
|
publish-x64:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: x64
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
strip-binaries: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-arm:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: arm
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
strip-binaries: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-arm64:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
|
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
target-platform: linux
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
strip-binaries: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
101
.github/workflows/macos-publish.yml
vendored
Normal file
101
.github/workflows/macos-publish.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
name: Publish MacOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build-image-sha:
|
||||||
|
type: string
|
||||||
|
description: 'SHA for electron/build image'
|
||||||
|
default: 'cf814a4d2501e8e843caea071a6b70a48e78b855'
|
||||||
|
required: true
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Uploads to Azure storage'
|
||||||
|
required: false
|
||||||
|
default: '1'
|
||||||
|
type: string
|
||||||
|
run-macos-publish:
|
||||||
|
description: 'Run the publish jobs vs just the build jobs'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkout-macos:
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
|
options: --user root
|
||||||
|
volumes:
|
||||||
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
with:
|
||||||
|
generate-sas-token: 'true'
|
||||||
|
|
||||||
|
publish-x64-darwin:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: x64
|
||||||
|
target-variant: darwin
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-x64-mas:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: x64
|
||||||
|
target-variant: mas
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-arm64-darwin:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: arm64
|
||||||
|
target-variant: darwin
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-arm64-mas:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: macos-14-xlarge
|
||||||
|
target-platform: macos
|
||||||
|
target-arch: arm64
|
||||||
|
target-variant: mas
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
93
.github/workflows/pipeline-electron-build-and-test-and-nan.yml
vendored
Normal file
93
.github/workflows/pipeline-electron-build-and-test-and-nan.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
name: Electron Build & Test (+ Node + NaN) Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux.'
|
||||||
|
required: true
|
||||||
|
target-arch:
|
||||||
|
type: string
|
||||||
|
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||||
|
required: true
|
||||||
|
build-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the build'
|
||||||
|
required: true
|
||||||
|
test-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the tests on'
|
||||||
|
required: true
|
||||||
|
build-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
test-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for testing'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
is-release:
|
||||||
|
description: 'Whether this build job is a release job'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
gn-build-type:
|
||||||
|
description: 'The gn build type - testing or release'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: testing
|
||||||
|
generate-symbols:
|
||||||
|
description: 'Whether or not to generate symbols'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Whether or not to upload build artifacts to external storage'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: '0'
|
||||||
|
is-asan:
|
||||||
|
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
with:
|
||||||
|
build-runs-on: ${{ inputs.build-runs-on }}
|
||||||
|
build-container: ${{ inputs.build-container }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
is-release: ${{ inputs.is-release }}
|
||||||
|
gn-build-type: ${{ inputs.gn-build-type }}
|
||||||
|
generate-symbols: ${{ inputs.generate-symbols }}
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
test:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||||
|
needs: build
|
||||||
|
with:
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
test-runs-on: ${{ inputs.test-runs-on }}
|
||||||
|
test-container: ${{ inputs.test-container }}
|
||||||
|
secrets: inherit
|
||||||
|
nn-test:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
|
||||||
|
needs: build
|
||||||
|
with:
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
test-runs-on: ${{ inputs.test-runs-on }}
|
||||||
|
test-container: ${{ inputs.test-container }}
|
||||||
|
gn-build-type: ${{ inputs.gn-build-type }}
|
||||||
|
secrets: inherit
|
||||||
90
.github/workflows/pipeline-electron-build-and-test.yml
vendored
Normal file
90
.github/workflows/pipeline-electron-build-and-test.yml
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
name: Electron Build & Test Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
|
required: true
|
||||||
|
target-arch:
|
||||||
|
type: string
|
||||||
|
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||||
|
required: true
|
||||||
|
build-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the build'
|
||||||
|
required: true
|
||||||
|
test-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the tests on'
|
||||||
|
required: true
|
||||||
|
build-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
test-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for testing'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
is-release:
|
||||||
|
description: 'Whether this build job is a release job'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
gn-build-type:
|
||||||
|
description: 'The gn build type - testing or release'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: testing
|
||||||
|
generate-symbols:
|
||||||
|
description: 'Whether or not to generate symbols'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Whether or not to upload build artifacts to external storage'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: '0'
|
||||||
|
is-asan:
|
||||||
|
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
with:
|
||||||
|
build-runs-on: ${{ inputs.build-runs-on }}
|
||||||
|
build-container: ${{ inputs.build-container }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
is-release: ${{ inputs.is-release }}
|
||||||
|
gn-build-type: ${{ inputs.gn-build-type }}
|
||||||
|
generate-symbols: ${{ inputs.generate-symbols }}
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
is-asan: ${{ inputs.is-asan}}
|
||||||
|
secrets: inherit
|
||||||
|
test:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||||
|
needs: build
|
||||||
|
with:
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
test-runs-on: ${{ inputs.test-runs-on }}
|
||||||
|
test-container: ${{ inputs.test-container }}
|
||||||
|
is-asan: ${{ inputs.is-asan}}
|
||||||
|
secrets: inherit
|
||||||
42
.github/workflows/pipeline-electron-docs-only.yml
vendored
Normal file
42
.github/workflows/pipeline-electron-docs-only.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Electron Docs Compile
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
container:
|
||||||
|
required: true
|
||||||
|
description: 'Container to run the docs-only ts compile in'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-docs-only-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docs-only:
|
||||||
|
name: Docs Only Compile
|
||||||
|
runs-on: electron-arc-linux-amd64-4core
|
||||||
|
timeout-minutes: 20
|
||||||
|
container: ${{ fromJSON(inputs.container) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Run TS/JS compile
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn create-typescript-definitions
|
||||||
|
node script/yarn tsc -p tsconfig.default_app.json --noEmit
|
||||||
|
for f in build/webpack/*.js
|
||||||
|
do
|
||||||
|
out="${f:29}"
|
||||||
|
if [ "$out" != "base.js" ]; then
|
||||||
|
node script/yarn webpack --config $f --output-filename=$out --output-path=./.tmp --env mode=development
|
||||||
|
fi
|
||||||
|
done
|
||||||
76
.github/workflows/pipeline-electron-lint.yml
vendored
Normal file
76
.github/workflows/pipeline-electron-lint.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
name: Electron Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
container:
|
||||||
|
required: true
|
||||||
|
description: 'Container to run lint in'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: electron-arc-linux-amd64-4core
|
||||||
|
timeout-minutes: 20
|
||||||
|
container: ${{ fromJSON(inputs.container) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Setup third_party Depot Tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
|
||||||
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
|
||||||
|
echo "$(pwd)/src/third_party/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Download GN Binary
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
||||||
|
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
|
||||||
|
|
||||||
|
cipd ensure -ensure-file - -root . <<-CIPD
|
||||||
|
\$ServiceURL https://chrome-infra-packages.appspot.com/
|
||||||
|
@Subdir src/buildtools/linux64
|
||||||
|
gn/gn/linux-amd64 $gn_version
|
||||||
|
CIPD
|
||||||
|
|
||||||
|
buildtools_path="$(pwd)/src/buildtools"
|
||||||
|
echo "CHROMIUM_BUILDTOOLS_PATH=$buildtools_path" >> $GITHUB_ENV
|
||||||
|
- name: Download clang-format Binary
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
||||||
|
|
||||||
|
mkdir -p src/buildtools
|
||||||
|
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/buildtools/DEPS?format=TEXT" | base64 -d > src/buildtools/DEPS
|
||||||
|
|
||||||
|
gclient sync --spec="solutions=[{'name':'src/buildtools','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':True},'managed':False}]"
|
||||||
|
- name: Run Lint
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# gn.py tries to find a gclient root folder starting from the current dir.
|
||||||
|
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
|
||||||
|
touch .gclient
|
||||||
|
# Another option would be to checkout "buildtools" inside the Electron checkout,
|
||||||
|
# but then we would lint its contents (at least gn format), and it doesn't pass it.
|
||||||
|
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn install --frozen-lockfile
|
||||||
|
node script/yarn lint
|
||||||
|
- name: Run Script Typechecker
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn tsc -p tsconfig.script.json
|
||||||
|
|
||||||
220
.github/workflows/pipeline-segment-electron-build.yml
vendored
Normal file
220
.github/workflows/pipeline-segment-electron-build.yml
vendored
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
name: Pipeline Segment - Electron Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
environment:
|
||||||
|
description: using the production or testing environment
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
|
required: true
|
||||||
|
target-arch:
|
||||||
|
type: string
|
||||||
|
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||||
|
required: true
|
||||||
|
target-variant:
|
||||||
|
type: string
|
||||||
|
description: 'Variant to build for, no effect on non-macOS target platforms. Can be darwin, mas or all.'
|
||||||
|
default: all
|
||||||
|
build-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the build'
|
||||||
|
required: true
|
||||||
|
build-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
is-release:
|
||||||
|
description: 'Whether this build job is a release job'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
gn-build-type:
|
||||||
|
description: 'The gn build type - testing or release'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: testing
|
||||||
|
generate-symbols:
|
||||||
|
description: 'Whether or not to generate symbols'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Whether or not to upload build artifacts to external storage'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: '0'
|
||||||
|
strip-binaries:
|
||||||
|
description: 'Strip the binaries before release (Linux only)'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
is-asan:
|
||||||
|
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||||
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||||
|
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
||||||
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || inputs.target-platform == 'win' && '--custom-var=checkout_win=True' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
||||||
|
ELECTRON_OUT_DIR: Default
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
runs-on: ${{ inputs.build-runs-on }}
|
||||||
|
container: ${{ fromJSON(inputs.build-container) }}
|
||||||
|
environment: ${{ inputs.environment }}
|
||||||
|
env:
|
||||||
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
|
steps:
|
||||||
|
- name: Create src dir
|
||||||
|
run: |
|
||||||
|
mkdir src
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Free up space (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/free-space-macos
|
||||||
|
- name: Check disk space after freeing up space
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
run: df -h
|
||||||
|
- name: Setup Node.js/npm
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
|
||||||
|
with:
|
||||||
|
node-version: 20.11.x
|
||||||
|
cache: yarn
|
||||||
|
cache-dependency-path: src/electron/yarn.lock
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Install AZCopy
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
run: brew install azcopy
|
||||||
|
- name: Set GN_EXTRA_ARGS for Linux
|
||||||
|
if: ${{ inputs.target-platform == 'linux' }}
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||||
|
if [ "${{ inputs.is-release }}" = true ]; then
|
||||||
|
GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false symbol_level=1'
|
||||||
|
else
|
||||||
|
GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false'
|
||||||
|
fi
|
||||||
|
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||||
|
GN_EXTRA_ARGS='target_cpu="arm64" fatal_linker_warnings=false enable_linux_installer=false'
|
||||||
|
elif [ "${{ inputs.is-asan }}" = true ]; then
|
||||||
|
GN_EXTRA_ARGS='is_asan=true'
|
||||||
|
fi
|
||||||
|
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Get Depot Tools
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: |
|
||||||
|
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
|
||||||
|
SEDOPTION="-i"
|
||||||
|
if [ "`uname`" = "Darwin" ]; then
|
||||||
|
SEDOPTION="-i ''"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
||||||
|
sed $SEDOPTION '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||||
|
|
||||||
|
# Ensure depot_tools does not update.
|
||||||
|
test -d depot_tools && cd depot_tools
|
||||||
|
touch .disable_auto_update
|
||||||
|
- name: Add Depot Tools to PATH
|
||||||
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Generate DEPS Hash
|
||||||
|
run: |
|
||||||
|
node src/electron/script/generate-deps-hash.js
|
||||||
|
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||||
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
|
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
|
- name: Restore src cache via AZCopy
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
|
- name: Restore src cache via AKS
|
||||||
|
if: ${{ inputs.target-platform == 'linux' }}
|
||||||
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
|
- name: Checkout src via gclient sync
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
with:
|
||||||
|
use-cache: 'false'
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Build Tools
|
||||||
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
- name: Init Build Tools
|
||||||
|
run: |
|
||||||
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||||
|
- name: Run Electron Only Hooks
|
||||||
|
run: |
|
||||||
|
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||||
|
- name: Regenerate DEPS Hash
|
||||||
|
run: |
|
||||||
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||||
|
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||||
|
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||||
|
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||||
|
- name: Fix Sync (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/fix-sync-macos
|
||||||
|
- name: Setup Number of Ninja Processes
|
||||||
|
run: |
|
||||||
|
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
|
||||||
|
- name: Free up space (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/free-space-macos
|
||||||
|
- name: Build Electron
|
||||||
|
if: ${{ inputs.target-platform != 'macos' || (inputs.target-variant == 'all' || inputs.target-variant == 'darwin') }}
|
||||||
|
uses: ./src/electron/.github/actions/build-electron
|
||||||
|
with:
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
|
||||||
|
is-release: '${{ inputs.is-release }}'
|
||||||
|
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||||
|
strip-binaries: '${{ inputs.strip-binaries }}'
|
||||||
|
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
||||||
|
is-asan: '${{ inputs.is-asan }}'
|
||||||
|
- name: Set GN_EXTRA_ARGS for MAS Build
|
||||||
|
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
|
||||||
|
run: |
|
||||||
|
echo "MAS_BUILD=true" >> $GITHUB_ENV
|
||||||
|
GN_EXTRA_ARGS='is_mas_build=true'
|
||||||
|
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||||
|
- name: Build Electron (MAS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
|
||||||
|
uses: ./src/electron/.github/actions/build-electron
|
||||||
|
with:
|
||||||
|
target-arch: ${{ inputs.target-arch }}
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
artifact-platform: 'mas'
|
||||||
|
is-release: '${{ inputs.is-release }}'
|
||||||
|
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||||
|
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
||||||
|
step-suffix: '(mas)'
|
||||||
155
.github/workflows/pipeline-segment-electron-gn-check.yml
vendored
Normal file
155
.github/workflows/pipeline-segment-electron-gn-check.yml
vendored
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
name: Pipeline Segment - Electron GN Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
|
required: true
|
||||||
|
target-archs:
|
||||||
|
type: string
|
||||||
|
description: 'Archs to check for, can be x64, x86, arm64 or arm space separated'
|
||||||
|
required: true
|
||||||
|
check-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the tests on'
|
||||||
|
required: true
|
||||||
|
check-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
gn-build-type:
|
||||||
|
description: 'The gn build type - testing or release'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: testing
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-gn-check-${{ inputs.target-platform }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
|
||||||
|
ELECTRON_OUT_DIR: Default
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gn-check:
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
runs-on: ${{ inputs.check-runs-on }}
|
||||||
|
container: ${{ fromJSON(inputs.check-container) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Cleanup disk space on macOS
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $TMPDIR/del-target
|
||||||
|
|
||||||
|
tmpify() {
|
||||||
|
if [ -d "$1" ]; then
|
||||||
|
sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
tmpify /Library/Developer/CoreSimulator
|
||||||
|
tmpify ~/Library/Developer/CoreSimulator
|
||||||
|
sudo rm -rf $TMPDIR/del-target
|
||||||
|
- name: Check disk space after freeing up space
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
run: df -h
|
||||||
|
- name: Install Build Tools
|
||||||
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
- name: Enable windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
run: |
|
||||||
|
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||||
|
- name: Generate DEPS Hash
|
||||||
|
run: |
|
||||||
|
node src/electron/script/generate-deps-hash.js
|
||||||
|
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||||
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
|
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
|
- name: Restore src cache via AZCopy
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
|
- name: Restore src cache via AKS
|
||||||
|
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
|
||||||
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
|
- name: Run Electron Only Hooks
|
||||||
|
run: |
|
||||||
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
|
||||||
|
echo "target_os=['win']" >> tmpgclient
|
||||||
|
fi
|
||||||
|
e d gclient runhooks --gclientfile=tmpgclient
|
||||||
|
|
||||||
|
# Fix VS Toolchain
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
rm -rf src/third_party/depot_tools/win_toolchain/vs_files
|
||||||
|
e d python3 src/build/vs_toolchain.py update --force
|
||||||
|
fi
|
||||||
|
- name: Regenerate DEPS Hash
|
||||||
|
run: |
|
||||||
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||||
|
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||||
|
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||||
|
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Default GN gen
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
git pack-refs
|
||||||
|
- name: Run GN Check for ${{ inputs.target-archs }}
|
||||||
|
run: |
|
||||||
|
for target_cpu in ${{ inputs.target-archs }}
|
||||||
|
do
|
||||||
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu
|
||||||
|
cd src
|
||||||
|
export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
|
||||||
|
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||||
|
if [ "$target_cpu" = "arm" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS build_tflite_with_xnnpack=false"
|
||||||
|
elif [ "$target_cpu" = "arm64" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS fatal_linker_warnings=false enable_linux_installer=false"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
e build --only-gen
|
||||||
|
|
||||||
|
e d gn check out/Default //electron:electron_lib
|
||||||
|
e d gn check out/Default //electron:electron_app
|
||||||
|
e d gn check out/Default //electron/shell/common/api:mojo
|
||||||
|
|
||||||
|
# Check the hunspell filenames
|
||||||
|
node electron/script/gen-hunspell-filenames.js --check
|
||||||
|
node electron/script/gen-libc++-filenames.js --check
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
247
.github/workflows/pipeline-segment-electron-test.yml
vendored
Normal file
247
.github/workflows/pipeline-segment-electron-test.yml
vendored
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
name: Pipeline Segment - Electron Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
|
required: true
|
||||||
|
target-arch:
|
||||||
|
type: string
|
||||||
|
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||||
|
required: true
|
||||||
|
test-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the tests on'
|
||||||
|
required: true
|
||||||
|
test-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
is-asan:
|
||||||
|
description: 'Building the Address Sanitizer (ASan) Linux build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
ELECTRON_OUT_DIR: Default
|
||||||
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
runs-on: ${{ inputs.test-runs-on }}
|
||||||
|
container: ${{ fromJSON(inputs.test-container) }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
|
||||||
|
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
|
||||||
|
env:
|
||||||
|
BUILD_TYPE: ${{ matrix.build-type }}
|
||||||
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
|
ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
|
steps:
|
||||||
|
- name: Fix node20 on arm32 runners
|
||||||
|
if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
|
||||||
|
run: |
|
||||||
|
cp $(which node) /mnt/runner-externals/node20/bin/
|
||||||
|
- name: Install Git on Windows arm64 runners
|
||||||
|
if: ${{ inputs.target-arch == 'arm64' && inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||||
|
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||||
|
choco install -y --no-progress git.install --params "'/GitAndUnixToolsOnPath'"
|
||||||
|
choco install -y --no-progress git
|
||||||
|
choco install -y --no-progress python --version 3.11.9
|
||||||
|
choco install -y --no-progress visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64"
|
||||||
|
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
- name: Setup Node.js/npm
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
|
||||||
|
with:
|
||||||
|
node-version: 20.11.x
|
||||||
|
- name: Add TCC permissions on macOS
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
run: |
|
||||||
|
configure_user_tccdb () {
|
||||||
|
local values=$1
|
||||||
|
local dbPath="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
|
||||||
|
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
|
||||||
|
sqlite3 "$dbPath" "$sqlQuery"
|
||||||
|
}
|
||||||
|
|
||||||
|
configure_sys_tccdb () {
|
||||||
|
local values=$1
|
||||||
|
local dbPath="/Library/Application Support/com.apple.TCC/TCC.db"
|
||||||
|
local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
|
||||||
|
sudo sqlite3 "$dbPath" "$sqlQuery"
|
||||||
|
}
|
||||||
|
|
||||||
|
userValuesArray=(
|
||||||
|
"'kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
|
||||||
|
"'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
|
||||||
|
"'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
|
||||||
|
)
|
||||||
|
for values in "${userValuesArray[@]}"; do
|
||||||
|
# Sonoma and higher have a few extra values
|
||||||
|
# Ref: https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/configure-tccdb-macos.sh
|
||||||
|
if [ "$OSTYPE" = "darwin23" ]; then
|
||||||
|
configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
|
||||||
|
configure_sys_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
|
||||||
|
else
|
||||||
|
configure_user_tccdb "$values"
|
||||||
|
configure_sys_tccdb "$values"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Get Depot Tools
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: |
|
||||||
|
git config --global core.filemode false
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global branch.autosetuprebase always
|
||||||
|
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
# Ensure depot_tools does not update.
|
||||||
|
test -d depot_tools && cd depot_tools
|
||||||
|
touch .disable_auto_update
|
||||||
|
- name: Add Depot Tools to PATH
|
||||||
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Load ASan specific environment variables
|
||||||
|
if: ${{ inputs.is-asan == true }}
|
||||||
|
run: |
|
||||||
|
echo "ARTIFACT_KEY=${{ matrix.build-type }}_${{ inputs.target-arch }}_asan" >> $GITHUB_ENV
|
||||||
|
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
|
||||||
|
echo "IS_ASAN=true" >> $GITHUB_ENV
|
||||||
|
- name: Download Generated Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
|
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
|
- name: Download Src Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
|
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
|
- name: Restore Generated Artifacts
|
||||||
|
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||||
|
- name: Unzip Dist, Mksnapshot & Chromedriver (win)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
cd src/out/Default
|
||||||
|
Expand-Archive -Force dist.zip -DestinationPath ./
|
||||||
|
Expand-Archive -Force chromedriver.zip -DestinationPath ./
|
||||||
|
Expand-Archive -Force mksnapshot.zip -DestinationPath ./
|
||||||
|
- name: Unzip Dist, Mksnapshot & Chromedriver (unix)
|
||||||
|
if: ${{ inputs.target-platform != 'win' }}
|
||||||
|
run: |
|
||||||
|
cd src/out/Default
|
||||||
|
unzip -:o dist.zip
|
||||||
|
unzip -:o chromedriver.zip
|
||||||
|
unzip -:o mksnapshot.zip
|
||||||
|
- name: Import & Trust Self-Signed Codesigning Cert on MacOS
|
||||||
|
if: ${{ inputs.target-platform == 'macos' && inputs.target-arch == 'x64' }}
|
||||||
|
run: |
|
||||||
|
sudo security authorizationdb write com.apple.trust-settings.admin allow
|
||||||
|
cd src/electron
|
||||||
|
./script/codesign/generate-identity.sh
|
||||||
|
- name: Install Datadog CLI
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn global add @datadog/datadog-ci
|
||||||
|
- name: Run Electron Tests
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
|
MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
|
||||||
|
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||||
|
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||||
|
DISPLAY: ':99.0'
|
||||||
|
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
|
||||||
|
# Get which tests are on this shard
|
||||||
|
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }})
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
if [ "${{ inputs.target-platform }}" != "linux" ]; then
|
||||||
|
echo "About to start tests"
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
if [ "${{ inputs.target-arch }}" = "x86" ]; then
|
||||||
|
export npm_config_arch="ia32"
|
||||||
|
fi
|
||||||
|
if [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||||
|
export ELECTRON_FORCE_TEST_SUITE_EXIT="true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||||
|
else
|
||||||
|
chown :builduser .. && chmod g+w ..
|
||||||
|
chown -R :builduser . && chmod -R g+w .
|
||||||
|
chmod 4755 ../out/Default/chrome-sandbox
|
||||||
|
runuser -u builduser -- git config --global --add safe.directory $(pwd)
|
||||||
|
if [ "${{ inputs.is-asan }}" == "true" ]; then
|
||||||
|
cd ..
|
||||||
|
ASAN_SYMBOLIZE="$PWD/tools/valgrind/asan/asan_symbolize.py --executable-path=$PWD/out/Default/electron"
|
||||||
|
export ASAN_OPTIONS="symbolize=0 handle_abort=1"
|
||||||
|
export G_SLICE=always-malloc
|
||||||
|
export NSS_DISABLE_ARENA_FREE_LIST=1
|
||||||
|
export NSS_DISABLE_UNLOAD=1
|
||||||
|
export LLVM_SYMBOLIZER_PATH=$PWD/third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer
|
||||||
|
export MOCHA_TIMEOUT=180000
|
||||||
|
echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
|
||||||
|
cd electron
|
||||||
|
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files | $ASAN_SYMBOLIZE
|
||||||
|
else
|
||||||
|
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
- name: Upload Test results to Datadog
|
||||||
|
env:
|
||||||
|
DD_ENV: ci
|
||||||
|
DD_SERVICE: electron
|
||||||
|
DD_API_KEY: ${{ secrets.DD_API_KEY }}
|
||||||
|
DD_CIVISIBILITY_LOGS_ENABLED: true
|
||||||
|
DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}"
|
||||||
|
run: |
|
||||||
|
if ! [ -z $DD_API_KEY ] && [ -f src/electron/junit/test-results-main.xml ]; then
|
||||||
|
export DATADOG_PATH=`node src/electron/script/yarn global bin`
|
||||||
|
$DATADOG_PATH/datadog-ci junit upload src/electron/junit/test-results-main.xml
|
||||||
|
fi
|
||||||
|
if: always() && !cancelled()
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
159
.github/workflows/pipeline-segment-node-nan-test.yml
vendored
Normal file
159
.github/workflows/pipeline-segment-node-nan-test.yml
vendored
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
name: Pipeline Segment - Node/Nan Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
type: string
|
||||||
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
|
required: true
|
||||||
|
target-arch:
|
||||||
|
type: string
|
||||||
|
description: 'Arch to build for, can be x64, arm64 or arm'
|
||||||
|
required: true
|
||||||
|
test-runs-on:
|
||||||
|
type: string
|
||||||
|
description: 'What host to run the tests on'
|
||||||
|
required: true
|
||||||
|
test-container:
|
||||||
|
type: string
|
||||||
|
description: 'JSON container information for aks runs-on'
|
||||||
|
required: false
|
||||||
|
default: '{"image":null}'
|
||||||
|
gn-build-type:
|
||||||
|
description: 'The gn build type - testing or release'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: testing
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
ELECTRON_OUT_DIR: Default
|
||||||
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
node-tests:
|
||||||
|
name: Run Node.js Tests
|
||||||
|
runs-on: electron-arc-linux-amd64-8core
|
||||||
|
timeout-minutes: 20
|
||||||
|
env:
|
||||||
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
|
BUILD_TYPE: linux
|
||||||
|
container: ${{ fromJSON(inputs.test-container) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Build Tools
|
||||||
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
- name: Init Build Tools
|
||||||
|
run: |
|
||||||
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Get Depot Tools
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: |
|
||||||
|
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
# Ensure depot_tools does not update.
|
||||||
|
test -d depot_tools && cd depot_tools
|
||||||
|
touch .disable_auto_update
|
||||||
|
- name: Add Depot Tools to PATH
|
||||||
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Download Generated Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
|
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
|
- name: Download Src Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
|
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
|
- name: Restore Generated Artifacts
|
||||||
|
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||||
|
- name: Unzip Dist
|
||||||
|
run: |
|
||||||
|
cd src/out/Default
|
||||||
|
unzip -:o dist.zip
|
||||||
|
- name: Setup Linux for Headless Testing
|
||||||
|
run: sh -e /etc/init.d/xvfb start
|
||||||
|
- name: Run Node.js Tests
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
node electron/script/node-spec-runner.js --default --jUnitDir=junit
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
|
nan-tests:
|
||||||
|
name: Run Nan Tests
|
||||||
|
runs-on: electron-arc-linux-amd64-4core
|
||||||
|
timeout-minutes: 20
|
||||||
|
env:
|
||||||
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
|
BUILD_TYPE: linux
|
||||||
|
container: ${{ fromJSON(inputs.test-container) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install Build Tools
|
||||||
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
- name: Init Build Tools
|
||||||
|
run: |
|
||||||
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
||||||
|
- name: Install Dependencies
|
||||||
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
|
- name: Get Depot Tools
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: |
|
||||||
|
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
# Ensure depot_tools does not update.
|
||||||
|
test -d depot_tools && cd depot_tools
|
||||||
|
touch .disable_auto_update
|
||||||
|
- name: Add Depot Tools to PATH
|
||||||
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
|
- name: Download Generated Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
|
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
|
- name: Download Src Artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
||||||
|
with:
|
||||||
|
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
|
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
|
- name: Restore Generated Artifacts
|
||||||
|
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||||
|
- name: Unzip Dist
|
||||||
|
run: |
|
||||||
|
cd src/out/Default
|
||||||
|
unzip -:o dist.zip
|
||||||
|
- name: Setup Linux for Headless Testing
|
||||||
|
run: sh -e /etc/init.d/xvfb start
|
||||||
|
- name: Run Node.js Tests
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
node electron/script/nan-spec-runner.js
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
shell: bash
|
||||||
|
if: always() && !cancelled()
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
4
.github/workflows/pull-request-labeled.yml
vendored
4
.github/workflows/pull-request-labeled.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Slack workflow
|
- name: Trigger Slack workflow
|
||||||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
|
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
|
||||||
with:
|
with:
|
||||||
payload: |
|
payload: |
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/edit-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 94
|
project-number: 94
|
||||||
|
|||||||
6
.github/workflows/scorecards.yml
vendored
6
.github/workflows/scorecards.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout code"
|
- name: "Checkout code"
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||||
# format to the repository Actions tab.
|
# format to the repository Actions tab.
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: SARIF file
|
name: SARIF file
|
||||||
path: results.sarif
|
path: results.sarif
|
||||||
@@ -50,6 +50,6 @@ jobs:
|
|||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
# Upload the results to GitHub's code scanning dashboard.
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
|
uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
2
.github/workflows/stable-prep-items.yml
vendored
2
.github/workflows/stable-prep-items.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
|
PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
|
||||||
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
||||||
- name: Update Completed Stable Prep Items
|
- name: Update Completed Stable Prep Items
|
||||||
uses: dsanders11/project-actions/completed-by@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
uses: dsanders11/project-actions/completed-by@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
|
||||||
with:
|
with:
|
||||||
field: Prep Status
|
field: Prep Status
|
||||||
field-value: ✅ Complete
|
field-value: ✅ Complete
|
||||||
|
|||||||
11
.github/workflows/update_appveyor_image.yml
vendored
11
.github/workflows/update_appveyor_image.yml
vendored
@@ -19,10 +19,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||||
|
with:
|
||||||
|
node-version: 20.11.x
|
||||||
- name: Yarn install
|
- name: Yarn install
|
||||||
run: |
|
run: |
|
||||||
node script/yarn.js install --frozen-lockfile
|
node script/yarn.js install --frozen-lockfile
|
||||||
@@ -39,7 +44,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
- name: (Optionally) Update Appveyor Image
|
- name: (Optionally) Update Appveyor Image
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||||
uses: mikefarah/yq@bb66c9c872a7a4cf3d6846c2ff6d182c66ec3f77 # v4.40.7
|
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 # v4.44.3
|
||||||
with:
|
with:
|
||||||
cmd: |
|
cmd: |
|
||||||
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
||||||
@@ -60,7 +65,7 @@ jobs:
|
|||||||
git add appveyor-woa.yml
|
git add appveyor-woa.yml
|
||||||
- name: (Optionally) Commit to Branch
|
- name: (Optionally) Commit to Branch
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||||
uses: dsanders11/github-app-commit-action@1dd0a2d22c564461d3f598b6858856e8842d7a16 # v1.1.0
|
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
|
||||||
with:
|
with:
|
||||||
message: 'build: update appveyor image to latest version'
|
message: 'build: update appveyor image to latest version'
|
||||||
ref: bump-appveyor-image
|
ref: bump-appveyor-image
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,7 +48,6 @@ ts-gen
|
|||||||
|
|
||||||
# Used to accelerate CI builds
|
# Used to accelerate CI builds
|
||||||
.depshash
|
.depshash
|
||||||
.depshash-target
|
|
||||||
|
|
||||||
# Used to accelerate builds after sync
|
# Used to accelerate builds after sync
|
||||||
patches/mtime-cache.json
|
patches/mtime-cache.json
|
||||||
|
|||||||
19
BUILD.gn
19
BUILD.gn
@@ -75,24 +75,17 @@ if (is_linux) {
|
|||||||
"notify_notification_set_image_from_pixbuf",
|
"notify_notification_set_image_from_pixbuf",
|
||||||
"notify_notification_set_timeout",
|
"notify_notification_set_timeout",
|
||||||
"notify_notification_set_urgency",
|
"notify_notification_set_urgency",
|
||||||
"notify_notification_set_hint_string",
|
"notify_notification_set_hint",
|
||||||
"notify_notification_show",
|
"notify_notification_show",
|
||||||
"notify_notification_close",
|
"notify_notification_close",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generates electron_gtk_stubs.h header which contains
|
# Generates headers which contain stubs for extracting function ptrs
|
||||||
# stubs for extracting function ptrs from the gtk library.
|
# from the gtk library. Function signatures for which stubs are
|
||||||
# Function signatures for which stubs are required should be
|
# required should be declared in the sig files.
|
||||||
# declared in electron_gtk.sigs, currently this file contains
|
|
||||||
# signatures for the functions used with native file chooser
|
|
||||||
# implementation. In future, this file can be extended to contain
|
|
||||||
# gtk4 stubs to switch gtk version in runtime.
|
|
||||||
generate_stubs("electron_gtk_stubs") {
|
generate_stubs("electron_gtk_stubs") {
|
||||||
sigs = [
|
sigs = [ "shell/browser/ui/electron_gdk_pixbuf.sigs" ]
|
||||||
"shell/browser/ui/electron_gdk_pixbuf.sigs",
|
|
||||||
"shell/browser/ui/electron_gtk.sigs",
|
|
||||||
]
|
|
||||||
extra_header = "shell/browser/ui/electron_gtk.fragment"
|
extra_header = "shell/browser/ui/electron_gtk.fragment"
|
||||||
output_name = "electron_gtk_stubs"
|
output_name = "electron_gtk_stubs"
|
||||||
public_deps = [ "//ui/gtk:gtk_config" ]
|
public_deps = [ "//ui/gtk:gtk_config" ]
|
||||||
@@ -665,6 +658,7 @@ source_set("electron_lib") {
|
|||||||
libs += [ "dwmapi.lib" ]
|
libs += [ "dwmapi.lib" ]
|
||||||
sources += [ "shell/common/asar/archive_win.cc" ]
|
sources += [ "shell/common/asar/archive_win.cc" ]
|
||||||
deps += [
|
deps += [
|
||||||
|
"//components/app_launch_prefetch",
|
||||||
"//components/crash/core/app:crash_export_thunks",
|
"//components/crash/core/app:crash_export_thunks",
|
||||||
"//ui/native_theme:native_theme_browser",
|
"//ui/native_theme:native_theme_browser",
|
||||||
"//ui/wm",
|
"//ui/wm",
|
||||||
@@ -750,6 +744,7 @@ source_set("electron_lib") {
|
|||||||
"//components/pdf/common:util",
|
"//components/pdf/common:util",
|
||||||
"//components/pdf/renderer",
|
"//components/pdf/renderer",
|
||||||
"//pdf",
|
"//pdf",
|
||||||
|
"//pdf:content_restriction",
|
||||||
]
|
]
|
||||||
sources += [
|
sources += [
|
||||||
"shell/browser/electron_pdf_document_helper_client.cc",
|
"shell/browser/electron_pdf_document_helper_client.cc",
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|||||||
version 2.0, available at
|
version 2.0, available at
|
||||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
Community Impact Guidelines were inspired by
|
||||||
enforcement ladder](https://github.com/mozilla/diversity).
|
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/inclusion).
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ propose changes to this document in a pull request.
|
|||||||
|
|
||||||
## [Issues](https://electronjs.org/docs/development/issues)
|
## [Issues](https://electronjs.org/docs/development/issues)
|
||||||
|
|
||||||
Issues are created [here](https://github.com/electron/electron/issues/new).
|
Issues are created [here](https://github.com/electron/electron/issues/new/choose).
|
||||||
|
|
||||||
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
|
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
|
||||||
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
|
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
|
||||||
|
|||||||
55
DEPS
55
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
|||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
'chromium_version':
|
'chromium_version':
|
||||||
'125.0.6412.0',
|
'126.0.6478.234',
|
||||||
'node_version':
|
'node_version':
|
||||||
'v20.12.2',
|
'v20.18.0',
|
||||||
'nan_version':
|
'nan_version':
|
||||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||||
'squirrel.mac_version':
|
'squirrel.mac_version':
|
||||||
@@ -48,6 +48,9 @@ vars = {
|
|||||||
# It's only needed to parse the native tests configurations.
|
# It's only needed to parse the native tests configurations.
|
||||||
'checkout_pyyaml': False,
|
'checkout_pyyaml': False,
|
||||||
|
|
||||||
|
# Can be used to disable the sysroot hooks.
|
||||||
|
'install_sysroot': True,
|
||||||
|
|
||||||
'use_rts': False,
|
'use_rts': False,
|
||||||
|
|
||||||
'mac_xcode_version': 'default',
|
'mac_xcode_version': 'default',
|
||||||
@@ -161,6 +164,54 @@ hooks = [
|
|||||||
'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python3", "script/lib/npx.py", "yarn@' + (Var("yarn_version")) + '", "install", "--frozen-lockfile"]);',
|
'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python3", "script/lib/npx.py", "yarn@' + (Var("yarn_version")) + '", "install", "--frozen-lockfile"]);',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_arm',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and checkout_arm',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=arm'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_arm64',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and checkout_arm64',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=arm64'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_x86',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and (checkout_x86 or checkout_x64)',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=x86'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_mips',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and checkout_mips',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=mips'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_mips64',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and checkout_mips64',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=mips64el'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'sysroot_x64',
|
||||||
|
'pattern': '.',
|
||||||
|
'condition': 'install_sysroot and checkout_linux and checkout_x64',
|
||||||
|
'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
|
||||||
|
'--sysroots-json-path=' + Var('sysroots_json_path'),
|
||||||
|
'--arch=x64'],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
recursedeps = [
|
recursedeps = [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[](https://electronjs.org)
|
[](https://electronjs.org)
|
||||||
|
|
||||||
[](https://circleci.com/gh/electron/electron/tree/main)
|
[](https://github.com/electron/electron/actions/workflows/build.yml)
|
||||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
|
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
|
||||||
[](https://discord.gg/electronjs)
|
[](https://discord.gg/electronjs)
|
||||||
|
|
||||||
@@ -9,8 +9,8 @@ View these docs in other languages on our [Crowdin](https://crowdin.com/project/
|
|||||||
|
|
||||||
The Electron framework lets you write cross-platform desktop applications
|
The Electron framework lets you write cross-platform desktop applications
|
||||||
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
|
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
|
||||||
[Chromium](https://www.chromium.org) and is used by the [Visual Studio
|
[Chromium](https://www.chromium.org) and is used by the
|
||||||
Code](https://github.com/Microsoft/vscode/) and many other [apps](https://electronjs.org/apps).
|
[Visual Studio Code](https://github.com/Microsoft/vscode/) and many other [apps](https://electronjs.org/apps).
|
||||||
|
|
||||||
Follow [@electronjs](https://twitter.com/electronjs) on Twitter for important
|
Follow [@electronjs](https://twitter.com/electronjs) on Twitter for important
|
||||||
announcements.
|
announcements.
|
||||||
|
|||||||
@@ -29,14 +29,14 @@
|
|||||||
|
|
||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
build_cloud: electronhq-16-core
|
build_cloud: electronhq-16-core
|
||||||
image: e-125.0.6412.0
|
image: e-131.0.6734.0
|
||||||
environment:
|
environment:
|
||||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
ELECTRON_ENABLE_STACK_DUMPING: 1
|
||||||
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
|
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
||||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
||||||
@@ -70,8 +70,9 @@ for:
|
|||||||
- job_name: Build Arm on X64 Windows
|
- job_name: Build Arm on X64 Windows
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
|
# TODO: Remove --ignore-engines once WOA image is up to node 20
|
||||||
- ps: |
|
- ps: |
|
||||||
node script/yarn.js install --frozen-lockfile
|
node script/yarn.js install --frozen-lockfile --ignore-engines
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
||||||
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
|
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
|
||||||
if ($LASTEXITCODE -eq 0) {
|
if ($LASTEXITCODE -eq 0) {
|
||||||
@@ -95,6 +96,8 @@ for:
|
|||||||
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
||||||
- depot_tools\bootstrap\win_tools.bat
|
- depot_tools\bootstrap\win_tools.bat
|
||||||
|
- ps: |
|
||||||
|
Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
|
||||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if (Test-Path -Path "$pwd\src\electron") {
|
if (Test-Path -Path "$pwd\src\electron") {
|
||||||
@@ -115,6 +118,11 @@ for:
|
|||||||
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
|
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
|
||||||
- ps: >-
|
- ps: >-
|
||||||
$env:RBE_experimental_credentials_helper_args = "print"
|
$env:RBE_experimental_credentials_helper_args = "print"
|
||||||
|
- ps: >-
|
||||||
|
if ($env:ELECTRON_RBE_JWT -eq '') {
|
||||||
|
$env:RBE_fail_early_min_action_count = "0"
|
||||||
|
$env:RBE_fail_early_min_fallback_ratio = "0"
|
||||||
|
}
|
||||||
- cd ..\..
|
- cd ..\..
|
||||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||||
- ps: >-
|
- ps: >-
|
||||||
@@ -141,7 +149,7 @@ for:
|
|||||||
- gn check out/Default //electron:electron_lib
|
- gn check out/Default //electron:electron_lib
|
||||||
- gn check out/Default //electron:electron_app
|
- gn check out/Default //electron:electron_app
|
||||||
- gn check out/Default //electron/shell/common/api:mojo
|
- gn check out/Default //electron/shell/common/api:mojo
|
||||||
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
|
- autoninja -j 300 -C out/Default electron:electron_app
|
||||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
||||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||||
@@ -166,8 +174,8 @@ for:
|
|||||||
if ($env:GN_CONFIG -eq 'release') {
|
if ($env:GN_CONFIG -eq 'release') {
|
||||||
# Needed for msdia140.dll on 64-bit windows
|
# Needed for msdia140.dll on 64-bit windows
|
||||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
||||||
autoninja -C out/Default electron:electron_symbols
|
|
||||||
}
|
}
|
||||||
|
- if "%GN_CONFIG%"=="release" ( autoninja -C out/Default electron:electron_symbols )
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
if ($env:GN_CONFIG -eq 'release') {
|
||||||
python3 electron\script\zip-symbols.py
|
python3 electron\script\zip-symbols.py
|
||||||
@@ -247,14 +255,18 @@ for:
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
IGNORE_YARN_INSTALL_ERROR: 1
|
IGNORE_YARN_INSTALL_ERROR: 1
|
||||||
ELECTRON_TEST_RESULTS_DIR: junit
|
ELECTRON_TEST_RESULTS_DIR: C:\projects\src\electron\junit
|
||||||
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||||
|
DD_ENV: ci
|
||||||
|
DD_SERVICE: electron
|
||||||
|
DD_CIVISIBILITY_LOGS_ENABLED: true
|
||||||
|
DD_GIT_REPOSITORY_URL: "https://github.com/electron/electron.git"
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
node script/yarn.js install --frozen-lockfile
|
node script/yarn.js install --frozen-lockfile --ignore-engines
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
||||||
if ($LASTEXITCODE -eq 0) {
|
if ($LASTEXITCODE -eq 0) {
|
||||||
Write-warning "Skipping build for doc only change"
|
Write-warning "Skipping build for doc only change"
|
||||||
@@ -262,6 +274,7 @@ for:
|
|||||||
} else {
|
} else {
|
||||||
$global:LASTEXITCODE = 0
|
$global:LASTEXITCODE = 0
|
||||||
}
|
}
|
||||||
|
- ps: Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "C:\projects\src\electron\datadog-ci.exe"
|
||||||
- cd ..
|
- cd ..
|
||||||
- mkdir out\Default
|
- mkdir out\Default
|
||||||
- cd ..
|
- cd ..
|
||||||
@@ -317,4 +330,13 @@ for:
|
|||||||
on_finish:
|
on_finish:
|
||||||
# Uncomment these lines to enable RDP
|
# Uncomment these lines to enable RDP
|
||||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||||
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
|
- if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml )
|
||||||
|
- ps: |
|
||||||
|
if ($env:DD_API_KEY) {
|
||||||
|
$env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT
|
||||||
|
$env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
|
||||||
|
$env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32"
|
||||||
|
if (Test-Path -Path "C:\projects\src\electron\junit\test-results-main.xml") {
|
||||||
|
C:\projects\src\electron\datadog-ci.exe junit upload --verbose C:\projects\src\electron\junit\test-results-main.xml
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
43
appveyor.yml
43
appveyor.yml
@@ -29,14 +29,14 @@
|
|||||||
|
|
||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
build_cloud: electronhq-16-core
|
build_cloud: electronhq-16-core
|
||||||
image: e-125.0.6412.0
|
image: e-131.0.6734.0
|
||||||
environment:
|
environment:
|
||||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
ELECTRON_ENABLE_STACK_DUMPING: 1
|
||||||
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
|
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
||||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
||||||
@@ -93,6 +93,8 @@ for:
|
|||||||
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
||||||
- depot_tools\bootstrap\win_tools.bat
|
- depot_tools\bootstrap\win_tools.bat
|
||||||
|
- ps: |
|
||||||
|
Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
|
||||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if (Test-Path -Path "$pwd\src\electron") {
|
if (Test-Path -Path "$pwd\src\electron") {
|
||||||
@@ -113,6 +115,11 @@ for:
|
|||||||
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
|
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
|
||||||
- ps: >-
|
- ps: >-
|
||||||
$env:RBE_experimental_credentials_helper_args = "print"
|
$env:RBE_experimental_credentials_helper_args = "print"
|
||||||
|
- ps: >-
|
||||||
|
if ($env:ELECTRON_RBE_JWT -eq '') {
|
||||||
|
$env:RBE_fail_early_min_action_count = "0"
|
||||||
|
$env:RBE_fail_early_min_fallback_ratio = "0"
|
||||||
|
}
|
||||||
- cd ..\..
|
- cd ..\..
|
||||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||||
- ps: >-
|
- ps: >-
|
||||||
@@ -139,7 +146,7 @@ for:
|
|||||||
- gn check out/Default //electron:electron_lib
|
- gn check out/Default //electron:electron_lib
|
||||||
- gn check out/Default //electron:electron_app
|
- gn check out/Default //electron:electron_app
|
||||||
- gn check out/Default //electron/shell/common/api:mojo
|
- gn check out/Default //electron/shell/common/api:mojo
|
||||||
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
|
- autoninja -j 300 -C out/Default electron:electron_app
|
||||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
||||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||||
@@ -163,8 +170,8 @@ for:
|
|||||||
if ($env:GN_CONFIG -eq 'release') {
|
if ($env:GN_CONFIG -eq 'release') {
|
||||||
# Needed for msdia140.dll on 64-bit windows
|
# Needed for msdia140.dll on 64-bit windows
|
||||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
||||||
autoninja -C out/Default electron:electron_symbols
|
|
||||||
}
|
}
|
||||||
|
- if "%GN_CONFIG%"=="release" ( autoninja -C out/Default electron:electron_symbols )
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
if ($env:GN_CONFIG -eq 'release') {
|
||||||
python3 electron\script\zip-symbols.py
|
python3 electron\script\zip-symbols.py
|
||||||
@@ -175,7 +182,12 @@ for:
|
|||||||
7z a pdb.zip out\Default\*.pdb
|
7z a pdb.zip out\Default\*.pdb
|
||||||
}
|
}
|
||||||
- ps: |
|
- ps: |
|
||||||
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
|
if ($env:TARGET_ARCH -eq 'ia32') {
|
||||||
|
$env:MANIFEST_ARCH = "x86"
|
||||||
|
} else {
|
||||||
|
$env:MANIFEST_ARCH = $env:TARGET_ARCH
|
||||||
|
}
|
||||||
|
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:MANIFEST_ARCH.manifest"
|
||||||
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
|
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "Zip contains files not listed in the manifest $manifest_file"
|
throw "Zip contains files not listed in the manifest $manifest_file"
|
||||||
@@ -238,6 +250,13 @@ for:
|
|||||||
only:
|
only:
|
||||||
- job_name: Test
|
- job_name: Test
|
||||||
|
|
||||||
|
environment:
|
||||||
|
DD_ENV: ci
|
||||||
|
DD_SERVICE: electron
|
||||||
|
DD_CIVISIBILITY_LOGS_ENABLED: true
|
||||||
|
DD_GIT_REPOSITORY_URL: "https://github.com/electron/electron.git"
|
||||||
|
ELECTRON_TEST_RESULTS_DIR: C:\projects\src\electron\junit
|
||||||
|
|
||||||
init:
|
init:
|
||||||
- ps: |
|
- ps: |
|
||||||
if ($env:RUN_TESTS -ne 'true') {
|
if ($env:RUN_TESTS -ne 'true') {
|
||||||
@@ -253,6 +272,7 @@ for:
|
|||||||
} else {
|
} else {
|
||||||
$global:LASTEXITCODE = 0
|
$global:LASTEXITCODE = 0
|
||||||
}
|
}
|
||||||
|
- npm install -g @datadog/datadog-ci
|
||||||
- cd ..
|
- cd ..
|
||||||
- mkdir out\Default
|
- mkdir out\Default
|
||||||
- cd ..
|
- cd ..
|
||||||
@@ -298,7 +318,7 @@ for:
|
|||||||
if ($env:TARGET_ARCH -eq 'ia32') {
|
if ($env:TARGET_ARCH -eq 'ia32') {
|
||||||
$env:npm_config_arch = "ia32"
|
$env:npm_config_arch = "ia32"
|
||||||
}
|
}
|
||||||
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log
|
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging
|
||||||
- cd ..
|
- cd ..
|
||||||
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
||||||
- echo "About to verify mksnapshot"
|
- echo "About to verify mksnapshot"
|
||||||
@@ -310,4 +330,13 @@ for:
|
|||||||
on_finish:
|
on_finish:
|
||||||
# Uncomment these lines to enable RDP
|
# Uncomment these lines to enable RDP
|
||||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||||
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
|
- if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml )
|
||||||
|
- ps: |
|
||||||
|
if ($env:RUN_TESTS -eq 'true' -And $env:DD_API_KEY) {
|
||||||
|
$env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT
|
||||||
|
$env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
|
||||||
|
$env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32"
|
||||||
|
if (Test-Path -Path "C:\projects\src\electron\junit\test-results-main.xml") {
|
||||||
|
C:\Users\appveyor\AppData\Roaming\npm\datadog-ci.ps1 junit upload --verbose C:\projects\src\electron\junit\test-results-main.xml
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
|||||||
root_extra_deps = [ "//electron" ]
|
root_extra_deps = [ "//electron" ]
|
||||||
|
|
||||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||||
node_module_version = 123
|
node_module_version = 125
|
||||||
|
|
||||||
v8_promise_internal_field_count = 1
|
v8_promise_internal_field_count = 1
|
||||||
v8_embedder_string = "-electron.0"
|
v8_embedder_string = "-electron.0"
|
||||||
@@ -50,10 +50,6 @@ is_cfi = false
|
|||||||
# TODO: fix this once sysroots have been updated.
|
# TODO: fix this once sysroots have been updated.
|
||||||
use_qt = false
|
use_qt = false
|
||||||
|
|
||||||
# https://chromium-review.googlesource.com/c/chromium/src/+/4365718
|
|
||||||
# TODO(codebytere): fix perfetto incompatibility with Node.js.
|
|
||||||
use_perfetto_client_library = false
|
|
||||||
|
|
||||||
# Disables the builtins PGO for V8
|
# Disables the builtins PGO for V8
|
||||||
v8_builtins_profiling_log_file = ""
|
v8_builtins_profiling_log_file = ""
|
||||||
|
|
||||||
@@ -68,3 +64,12 @@ v8_enable_private_mapping_fork_optimization = true
|
|||||||
|
|
||||||
# Expose public V8 symbols for native modules.
|
# Expose public V8 symbols for native modules.
|
||||||
v8_expose_public_symbols = true
|
v8_expose_public_symbols = true
|
||||||
|
|
||||||
|
# Disables unsafe-buffers-usage plugin due to incompatibilities with our reclient implementation
|
||||||
|
# Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5426599
|
||||||
|
# Ref: https://github.com/electron/electron/commit/8e20f16ea35eeaeb149ae63bad3703d782665f6a
|
||||||
|
clang_unsafe_buffers_paths = ""
|
||||||
|
|
||||||
|
# Disable snapshotting a page when printing for its content to be analyzed for
|
||||||
|
# sensitive content by enterprise users.
|
||||||
|
enterprise_cloud_content_analysis = false
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const WrapperPlugin = require('wrapper-webpack-plugin');
|
||||||
|
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const webpack = require('webpack');
|
|
||||||
const TerserPlugin = require('terser-webpack-plugin');
|
|
||||||
const WrapperPlugin = require('wrapper-webpack-plugin');
|
|
||||||
|
|
||||||
const electronRoot = path.resolve(__dirname, '../..');
|
const electronRoot = path.resolve(__dirname, '../..');
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def skip_path(dep, dist_zip, target_cpu):
|
|||||||
and dep == "snapshot_blob.bin"
|
and dep == "snapshot_blob.bin"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if should_skip:
|
if should_skip and os.environ.get('ELECTRON_DEBUG_ZIP_SKIP') == '1':
|
||||||
print("Skipping {}".format(dep))
|
print("Skipping {}".format(dep))
|
||||||
return should_skip
|
return should_skip
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/ui/frame/window_frame_util.h",
|
"//chrome/browser/ui/frame/window_frame_util.h",
|
||||||
"//chrome/browser/ui/ui_features.cc",
|
"//chrome/browser/ui/ui_features.cc",
|
||||||
"//chrome/browser/ui/ui_features.h",
|
"//chrome/browser/ui/ui_features.h",
|
||||||
|
"//chrome/browser/ui/view_ids.h",
|
||||||
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
|
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
|
||||||
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
|
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
|
||||||
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
|
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
|
||||||
@@ -151,12 +152,15 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
|
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
|
||||||
"//chrome/browser/process_singleton_win.cc",
|
"//chrome/browser/process_singleton_win.cc",
|
||||||
"//chrome/browser/ui/frame/window_frame_util.h",
|
"//chrome/browser/ui/frame/window_frame_util.h",
|
||||||
"//chrome/browser/ui/view_ids.h",
|
|
||||||
"//chrome/browser/win/chrome_process_finder.cc",
|
"//chrome/browser/win/chrome_process_finder.cc",
|
||||||
"//chrome/browser/win/chrome_process_finder.h",
|
"//chrome/browser/win/chrome_process_finder.h",
|
||||||
|
"//chrome/browser/win/chrome_select_file_dialog_factory.cc",
|
||||||
|
"//chrome/browser/win/chrome_select_file_dialog_factory.h",
|
||||||
"//chrome/browser/win/titlebar_config.cc",
|
"//chrome/browser/win/titlebar_config.cc",
|
||||||
"//chrome/browser/win/titlebar_config.h",
|
"//chrome/browser/win/titlebar_config.h",
|
||||||
"//chrome/browser/win/titlebar_config.h",
|
"//chrome/browser/win/titlebar_config.h",
|
||||||
|
"//chrome/browser/win/util_win_service.cc",
|
||||||
|
"//chrome/browser/win/util_win_service.h",
|
||||||
"//chrome/child/v8_crashpad_support_win.cc",
|
"//chrome/child/v8_crashpad_support_win.cc",
|
||||||
"//chrome/child/v8_crashpad_support_win.h",
|
"//chrome/child/v8_crashpad_support_win.h",
|
||||||
]
|
]
|
||||||
@@ -186,6 +190,7 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/resource_coordinator:mojo_bindings",
|
"//chrome/browser/resource_coordinator:mojo_bindings",
|
||||||
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
|
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
|
||||||
"//components/enterprise/buildflags",
|
"//components/enterprise/buildflags",
|
||||||
|
"//components/enterprise/common/proto:connectors_proto",
|
||||||
"//components/safe_browsing/core/browser/db:safebrowsing_proto",
|
"//components/safe_browsing/core/browser/db:safebrowsing_proto",
|
||||||
"//components/vector_icons:vector_icons",
|
"//components/vector_icons:vector_icons",
|
||||||
"//ui/snapshot",
|
"//ui/snapshot",
|
||||||
@@ -237,7 +242,10 @@ static_library("chrome") {
|
|||||||
"//chrome/services/util_win:lib",
|
"//chrome/services/util_win:lib",
|
||||||
"//components/webapps/common:mojo_bindings",
|
"//components/webapps/common:mojo_bindings",
|
||||||
]
|
]
|
||||||
deps += [ "//components/segmentation_platform/public/proto" ]
|
deps += [
|
||||||
|
"//chrome/services/util_win/public/mojom",
|
||||||
|
"//components/segmentation_platform/public/proto",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { shell } from 'electron/common';
|
import { shell } from 'electron/common';
|
||||||
import { app, dialog, BrowserWindow, ipcMain } from 'electron/main';
|
import { app, dialog, BrowserWindow, ipcMain } from 'electron/main';
|
||||||
|
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as url from 'node:url';
|
import * as url from 'node:url';
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as fs from 'node:fs';
|
|||||||
import { Module } from 'node:module';
|
import { Module } from 'node:module';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as url from 'node:url';
|
import * as url from 'node:url';
|
||||||
|
|
||||||
const { app, dialog } = electron;
|
const { app, dialog } = electron;
|
||||||
|
|
||||||
type DefaultAppOptions = {
|
type DefaultAppOptions = {
|
||||||
@@ -255,6 +256,7 @@ async function startRepl () {
|
|||||||
// start the default app.
|
// start the default app.
|
||||||
if (option.file && !option.webdriver) {
|
if (option.file && !option.webdriver) {
|
||||||
const file = option.file;
|
const file = option.file;
|
||||||
|
// eslint-disable-next-line n/no-deprecated-api
|
||||||
const protocol = url.parse(file).protocol;
|
const protocol = url.parse(file).protocol;
|
||||||
const extension = path.extname(file);
|
const extension = path.extname(file);
|
||||||
if (protocol === 'http:' || protocol === 'https:' || protocol === 'file:' || protocol === 'chrome:') {
|
if (protocol === 'http:' || protocol === 'https:' || protocol === 'file:' || protocol === 'chrome:') {
|
||||||
|
|||||||
7
docs/api/app.md
Executable file → Normal file
7
docs/api/app.md
Executable file → Normal file
@@ -1265,7 +1265,7 @@ Returns `Object`:
|
|||||||
|
|
||||||
* `openAtLogin` boolean - `true` if the app is set to open at login.
|
* `openAtLogin` boolean - `true` if the app is set to open at login.
|
||||||
* `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open as hidden at login. This does not work on macOS 13 and up.
|
* `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open as hidden at login. This does not work on macOS 13 and up.
|
||||||
* `wasOpenedAtLogin` boolean _macOS_ _Deprecated_ - `true` if the app was opened at login automatically. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
* `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login automatically.
|
||||||
* `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
* `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
||||||
* `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
* `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
||||||
* `status` string _macOS_ - can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
|
* `status` string _macOS_ - can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
|
||||||
@@ -1282,8 +1282,7 @@ Returns `Object`:
|
|||||||
* `settings` Object
|
* `settings` Object
|
||||||
* `openAtLogin` boolean (optional) - `true` to open the app at login, `false` to remove
|
* `openAtLogin` boolean (optional) - `true` to open the app at login, `false` to remove
|
||||||
the app as a login item. Defaults to `false`.
|
the app as a login item. Defaults to `false`.
|
||||||
* `openAsHidden` boolean (optional) _macOS_ _Deprecated_ - `true` to open the app as hidden. Defaults to `false`. The user can edit this setting from the System Preferences so `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is opened to know the current value. This setting is not available on [MAS build
|
* `openAsHidden` boolean (optional) _macOS_ _Deprecated_ - `true` to open the app as hidden. Defaults to `false`. The user can edit this setting from the System Preferences so `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is opened to know the current value. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
|
||||||
s][mas-builds] or on macOS 13 and up.
|
|
||||||
* `type` string (optional) _macOS_ - The type of service to add as a login item. Defaults to `mainAppService`. Only available on macOS 13 and up.
|
* `type` string (optional) _macOS_ - The type of service to add as a login item. Defaults to `mainAppService`. Only available on macOS 13 and up.
|
||||||
* `mainAppService` - The primary application.
|
* `mainAppService` - The primary application.
|
||||||
* `agentService` - The property list name for a launch agent. The property list name must correspond to a property list in the app’s `Contents/Library/LaunchAgents` directory.
|
* `agentService` - The property list name for a launch agent. The property list name must correspond to a property list in the app’s `Contents/Library/LaunchAgents` directory.
|
||||||
@@ -1358,7 +1357,7 @@ Show the app's about panel options. These options can be overridden with `app.se
|
|||||||
* `credits` string (optional) _macOS_ _Windows_ - Credit information.
|
* `credits` string (optional) _macOS_ _Windows_ - Credit information.
|
||||||
* `authors` string[] (optional) _Linux_ - List of app authors.
|
* `authors` string[] (optional) _Linux_ - List of app authors.
|
||||||
* `website` string (optional) _Linux_ - The app's website.
|
* `website` string (optional) _Linux_ - The app's website.
|
||||||
* `iconPath` string (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
|
* `iconPath` string (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio. On Windows, a 48x48 PNG will result in the best visual quality.
|
||||||
|
|
||||||
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
|
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ In addition, there are some subtle differences on each platform:
|
|||||||
|
|
||||||
On macOS, the `autoUpdater` module is built upon [Squirrel.Mac][squirrel-mac],
|
On macOS, the `autoUpdater` module is built upon [Squirrel.Mac][squirrel-mac],
|
||||||
meaning you don't need any special setup to make it work. For server-side
|
meaning you don't need any special setup to make it work. For server-side
|
||||||
requirements, you can read [Server Support][server-support]. Note that [App
|
requirements, you can read [Server Support][server-support]. Note that
|
||||||
Transport Security](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35) (ATS) applies to all requests made as part of the
|
[App Transport Security](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35)
|
||||||
|
(ATS) applies to all requests made as part of the
|
||||||
update process. Apps that need to disable ATS can add the
|
update process. Apps that need to disable ATS can add the
|
||||||
`NSAllowsArbitraryLoads` key to their app's plist.
|
`NSAllowsArbitraryLoads` key to their app's plist.
|
||||||
|
|
||||||
|
|||||||
@@ -126,10 +126,18 @@ or session log off.
|
|||||||
|
|
||||||
#### Event: 'blur'
|
#### Event: 'blur'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
|
||||||
Emitted when the window loses focus.
|
Emitted when the window loses focus.
|
||||||
|
|
||||||
#### Event: 'focus'
|
#### Event: 'focus'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
|
||||||
Emitted when the window gains focus.
|
Emitted when the window gains focus.
|
||||||
|
|
||||||
#### Event: 'show'
|
#### Event: 'show'
|
||||||
@@ -600,7 +608,7 @@ Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
|
|||||||
on the right edge and 50 pixels of controls below the player. In order to
|
on the right edge and 50 pixels of controls below the player. In order to
|
||||||
maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
||||||
the player itself we would call this function with arguments of 16/9 and
|
the player itself we would call this function with arguments of 16/9 and
|
||||||
{ width: 40, height: 50 }. The second argument doesn't care where the extra width and height
|
\{ width: 40, height: 50 \}. The second argument doesn't care where the extra width and height
|
||||||
are within the content view--only that they exist. Sum any extra width and
|
are within the content view--only that they exist. Sum any extra width and
|
||||||
height areas you have within the overall content view.
|
height areas you have within the overall content view.
|
||||||
|
|
||||||
@@ -1370,15 +1378,16 @@ machine has a touch bar.
|
|||||||
**Note:** The TouchBar API is currently experimental and may change or be
|
**Note:** The TouchBar API is currently experimental and may change or be
|
||||||
removed in future Electron releases.
|
removed in future Electron releases.
|
||||||
|
|
||||||
#### `win.setTitleBarOverlay(options)` _Windows_
|
#### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
|
||||||
|
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled.
|
* `color` String (optional) - The CSS color of the Window Controls Overlay when enabled.
|
||||||
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled.
|
* `symbolColor` String (optional) - The CSS color of the symbols on the Window Controls Overlay when enabled.
|
||||||
* `height` Integer (optional) _Windows_ - The height of the title bar and Window Controls Overlay in pixels.
|
* `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels.
|
||||||
|
|
||||||
On a Window with Window Controls Overlay already enabled, this method updates
|
On a Window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay.
|
||||||
the style of the title bar overlay.
|
|
||||||
|
On Linux, the `symbolColor` is automatically calculated to have minimum accessible contrast to the `color` if not explicitly set.
|
||||||
|
|
||||||
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
|
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
|
||||||
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc
|
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc
|
||||||
|
|||||||
@@ -690,6 +690,8 @@ Sets whether the window should be in fullscreen mode.
|
|||||||
|
|
||||||
Returns `boolean` - Whether the window is in fullscreen mode.
|
Returns `boolean` - Whether the window is in fullscreen mode.
|
||||||
|
|
||||||
|
**Note:** On macOS, fullscreen transitions take place asynchronously. When querying for a BrowserWindow's fullscreen status, you should ensure that either the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events have been emitted.
|
||||||
|
|
||||||
#### `win.setSimpleFullScreen(flag)` _macOS_
|
#### `win.setSimpleFullScreen(flag)` _macOS_
|
||||||
|
|
||||||
* `flag` boolean
|
* `flag` boolean
|
||||||
@@ -723,7 +725,7 @@ Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
|
|||||||
on the right edge and 50 pixels of controls below the player. In order to
|
on the right edge and 50 pixels of controls below the player. In order to
|
||||||
maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
|
||||||
the player itself we would call this function with arguments of 16/9 and
|
the player itself we would call this function with arguments of 16/9 and
|
||||||
{ width: 40, height: 50 }. The second argument doesn't care where the extra width and height
|
\{ width: 40, height: 50 \}. The second argument doesn't care where the extra width and height
|
||||||
are within the content view--only that they exist. Sum any extra width and
|
are within the content view--only that they exist. Sum any extra width and
|
||||||
height areas you have within the overall content view.
|
height areas you have within the overall content view.
|
||||||
|
|
||||||
@@ -1641,15 +1643,16 @@ with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last
|
|||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
#### `win.setTitleBarOverlay(options)` _Windows_
|
#### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
|
||||||
|
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled.
|
* `color` String (optional) - The CSS color of the Window Controls Overlay when enabled.
|
||||||
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled.
|
* `symbolColor` String (optional) - The CSS color of the symbols on the Window Controls Overlay when enabled.
|
||||||
* `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels.
|
* `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels.
|
||||||
|
|
||||||
On a Window with Window Controls Overlay already enabled, this method updates
|
On a window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay.
|
||||||
the style of the title bar overlay.
|
|
||||||
|
On Linux, the `symbolColor` is automatically calculated to have minimum accessible contrast to the `color` if not explicitly set.
|
||||||
|
|
||||||
[page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
|
[page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
|
||||||
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
|
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ following properties:
|
|||||||
[`request.followRedirect`](#requestfollowredirect) is invoked synchronously
|
[`request.followRedirect`](#requestfollowredirect) is invoked synchronously
|
||||||
during the [`redirect`](#event-redirect) event. Defaults to `follow`.
|
during the [`redirect`](#event-redirect) event. Defaults to `follow`.
|
||||||
* `origin` string (optional) - The origin URL of the request.
|
* `origin` string (optional) - The origin URL of the request.
|
||||||
* `referrerPolicy` string (optional) - can be `""`, `no-referrer`,
|
* `referrerPolicy` string (optional) - can be "", `no-referrer`,
|
||||||
`no-referrer-when-downgrade`, `origin`, `origin-when-cross-origin`,
|
`no-referrer-when-downgrade`, `origin`, `origin-when-cross-origin`,
|
||||||
`unsafe-url`, `same-origin`, `strict-origin`, or
|
`unsafe-url`, `same-origin`, `strict-origin`, or
|
||||||
`strict-origin-when-cross-origin`. Defaults to
|
`strict-origin-when-cross-origin`. Defaults to
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ Aliased to `--debug[=[host:]port`.
|
|||||||
|
|
||||||
Specify ways of the inspector web socket url exposure.
|
Specify ways of the inspector web socket url exposure.
|
||||||
|
|
||||||
By default inspector websocket url is available in stderr and under /json/list endpoint on http://host:port/json/list.
|
By default inspector websocket url is available in stderr and under /json/list endpoint on `http://host:port/json/list`.
|
||||||
|
|
||||||
### `--no-deprecation`
|
### `--no-deprecation`
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ The `contentTracing` module has the following methods:
|
|||||||
Returns `Promise<string[]>` - resolves with an array of category groups once all child processes have acknowledged the `getCategories` request
|
Returns `Promise<string[]>` - resolves with an array of category groups once all child processes have acknowledged the `getCategories` request
|
||||||
|
|
||||||
Get a set of category groups. The category groups can change as new code paths
|
Get a set of category groups. The category groups can change as new code paths
|
||||||
are reached. See also the [list of built-in tracing
|
are reached. See also the
|
||||||
categories](https://chromium.googlesource.com/chromium/src/+/main/base/trace_event/builtin_categories.h).
|
[list of built-in tracing categories](https://chromium.googlesource.com/chromium/src/+/main/base/trace_event/builtin_categories.h).
|
||||||
|
|
||||||
> **NOTE:** Electron adds a non-default tracing category called `"electron"`.
|
> **NOTE:** Electron adds a non-default tracing category called `"electron"`.
|
||||||
> This category can be used to capture Electron-specific tracing events.
|
> This category can be used to capture Electron-specific tracing events.
|
||||||
|
|||||||
@@ -138,6 +138,25 @@ has been included below for completeness:
|
|||||||
|
|
||||||
If the type you care about is not in the above table, it is probably not supported.
|
If the type you care about is not in the above table, it is probably not supported.
|
||||||
|
|
||||||
|
### Exposing ipcRenderer
|
||||||
|
|
||||||
|
Attempting to send the entire `ipcRenderer` module as an object over the `contextBridge` will result in
|
||||||
|
an empty object on the receiving side of the bridge. Sending over `ipcRenderer` in full can let any
|
||||||
|
code send any message, which is a security footgun. To interact through `ipcRenderer`, provide a safe wrapper
|
||||||
|
like below:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Preload (Isolated World)
|
||||||
|
contextBridge.exposeInMainWorld('electron', {
|
||||||
|
onMyEventName: (callback) => ipcRenderer.on('MyEventName', (e, ...args) => callback(args))
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
```js @ts-nocheck
|
||||||
|
// Renderer (Main World)
|
||||||
|
window.electron.onMyEventName(data => { /* ... */ })
|
||||||
|
```
|
||||||
|
|
||||||
### Exposing Node Global Symbols
|
### Exposing Node Global Symbols
|
||||||
|
|
||||||
The `contextBridge` can be used by the preload script to give your renderer access to Node APIs.
|
The `contextBridge` can be used by the preload script to give your renderer access to Node APIs.
|
||||||
|
|||||||
@@ -9,80 +9,66 @@ The following example shows how to capture video from a desktop window whose
|
|||||||
title is `Electron`:
|
title is `Electron`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// In the main process.
|
// main.js
|
||||||
const { BrowserWindow, desktopCapturer } = require('electron')
|
const { app, BrowserWindow, desktopCapturer, session } = require('electron')
|
||||||
|
|
||||||
const mainWindow = new BrowserWindow()
|
app.whenReady().then(() => {
|
||||||
|
const mainWindow = new BrowserWindow()
|
||||||
|
|
||||||
desktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources => {
|
session.defaultSession.setDisplayMediaRequestHandler((request, callback) => {
|
||||||
for (const source of sources) {
|
desktopCapturer.getSources({ types: ['screen'] }).then((sources) => {
|
||||||
if (source.name === 'Electron') {
|
// Grant access to the first screen found.
|
||||||
mainWindow.webContents.send('SET_SOURCE', source.id)
|
callback({ video: sources[0], audio: 'loopback' })
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
```js @ts-nocheck
|
|
||||||
// In the preload script.
|
|
||||||
const { ipcRenderer } = require('electron')
|
|
||||||
|
|
||||||
ipcRenderer.on('SET_SOURCE', async (event, sourceId) => {
|
|
||||||
try {
|
|
||||||
const stream = await navigator.mediaDevices.getUserMedia({
|
|
||||||
audio: false,
|
|
||||||
video: {
|
|
||||||
mandatory: {
|
|
||||||
chromeMediaSource: 'desktop',
|
|
||||||
chromeMediaSourceId: sourceId,
|
|
||||||
minWidth: 1280,
|
|
||||||
maxWidth: 1280,
|
|
||||||
minHeight: 720,
|
|
||||||
maxHeight: 720
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
handleStream(stream)
|
})
|
||||||
} catch (e) {
|
|
||||||
handleError(e)
|
mainWindow.loadFile('index.html')
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleStream (stream) {
|
|
||||||
const video = document.querySelector('video')
|
|
||||||
video.srcObject = stream
|
|
||||||
video.onloadedmetadata = (e) => video.play()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleError (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To capture video from a source provided by `desktopCapturer` the constraints
|
|
||||||
passed to [`navigator.mediaDevices.getUserMedia`][] must include
|
|
||||||
`chromeMediaSource: 'desktop'`, and `audio: false`.
|
|
||||||
|
|
||||||
To capture both audio and video from the entire desktop the constraints passed
|
|
||||||
to [`navigator.mediaDevices.getUserMedia`][] must include `chromeMediaSource: 'desktop'`,
|
|
||||||
for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint.
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const constraints = {
|
// renderer.js
|
||||||
audio: {
|
const startButton = document.getElementById('startButton')
|
||||||
mandatory: {
|
const stopButton = document.getElementById('stopButton')
|
||||||
chromeMediaSource: 'desktop'
|
const video = document.querySelector('video')
|
||||||
|
|
||||||
|
startButton.addEventListener('click', () => {
|
||||||
|
navigator.mediaDevices.getDisplayMedia({
|
||||||
|
audio: true,
|
||||||
|
video: {
|
||||||
|
width: 320,
|
||||||
|
height: 240,
|
||||||
|
frameRate: 30
|
||||||
}
|
}
|
||||||
},
|
}).then(stream => {
|
||||||
video: {
|
video.srcObject = stream
|
||||||
mandatory: {
|
video.onloadedmetadata = (e) => video.play()
|
||||||
chromeMediaSource: 'desktop'
|
}).catch(e => console.log(e))
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
stopButton.addEventListener('click', () => {
|
||||||
|
video.pause()
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- index.html -->
|
||||||
|
<html>
|
||||||
|
<meta http-equiv="content-security-policy" content="script-src 'self' 'unsafe-inline'" />
|
||||||
|
<body>
|
||||||
|
<button id="startButton" class="button">Start</button>
|
||||||
|
<button id="stopButton" class="button">Stop</button>
|
||||||
|
<video width="320" height="240" autoplay></video>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
See [`navigator.mediaDevices.getDisplayMedia`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia) for more information.
|
||||||
|
|
||||||
|
**Note:** `navigator.mediaDevices.getDisplayMedia` does not permit the use of `deviceId` for
|
||||||
|
selection of a source - see [specification](https://w3c.github.io/mediacapture-screen-share/#constraints).
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
The `desktopCapturer` module has the following methods:
|
The `desktopCapturer` module has the following methods:
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ dialog.showOpenDialog(mainWindow, {
|
|||||||
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
|
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
|
||||||
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
|
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
|
||||||
|
|
||||||
Returns `string | undefined`, the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
|
Returns `string`, the path of the file chosen by the user; if the dialog is cancelled it returns an empty string.
|
||||||
|
|
||||||
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
|
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ The `filters` specifies an array of file types that can be displayed, see
|
|||||||
Returns `Promise<Object>` - Resolve with an object containing the following:
|
Returns `Promise<Object>` - Resolve with an object containing the following:
|
||||||
|
|
||||||
* `canceled` boolean - whether or not the dialog was canceled.
|
* `canceled` boolean - whether or not the dialog was canceled.
|
||||||
* `filePath` string (optional) - If the dialog is canceled, this will be `undefined`.
|
* `filePath` string - If the dialog is canceled, this will be an empty string.
|
||||||
* `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
|
* `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
|
||||||
|
|
||||||
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
|
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ Returns `string` - The file name of the download item.
|
|||||||
disk. If user changes the file name in a prompted download saving dialog, the
|
disk. If user changes the file name in a prompted download saving dialog, the
|
||||||
actual name of saved file will be different.
|
actual name of saved file will be different.
|
||||||
|
|
||||||
|
#### `downloadItem.getCurrentBytesPerSecond()`
|
||||||
|
|
||||||
|
Returns `Integer` - The current download speed in bytes per second.
|
||||||
|
|
||||||
#### `downloadItem.getTotalBytes()`
|
#### `downloadItem.getTotalBytes()`
|
||||||
|
|
||||||
Returns `Integer` - The total size in bytes of the download item.
|
Returns `Integer` - The total size in bytes of the download item.
|
||||||
@@ -155,6 +159,10 @@ If the size is unknown, it returns 0.
|
|||||||
|
|
||||||
Returns `Integer` - The received bytes of the download item.
|
Returns `Integer` - The received bytes of the download item.
|
||||||
|
|
||||||
|
#### `downloadItem.getPercentComplete()`
|
||||||
|
|
||||||
|
Returns `Integer` - The download completion in percent.
|
||||||
|
|
||||||
#### `downloadItem.getContentDisposition()`
|
#### `downloadItem.getContentDisposition()`
|
||||||
|
|
||||||
Returns `string` - The Content-Disposition field from the response
|
Returns `string` - The Content-Disposition field from the response
|
||||||
@@ -184,6 +192,10 @@ Returns `string` - ETag header value.
|
|||||||
Returns `Double` - Number of seconds since the UNIX epoch when the download was
|
Returns `Double` - Number of seconds since the UNIX epoch when the download was
|
||||||
started.
|
started.
|
||||||
|
|
||||||
|
#### `downloadItem.getEndTime()`
|
||||||
|
|
||||||
|
Returns `Double` - Number of seconds since the UNIX epoch when the download ended.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
#### `downloadItem.savePath`
|
#### `downloadItem.savePath`
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ Unsupported options are:
|
|||||||
--http-parser
|
--http-parser
|
||||||
```
|
```
|
||||||
|
|
||||||
If the [`nodeOptions` fuse](../tutorial/fuses.md#L27) is disabled, `NODE_OPTIONS` will be ignored.
|
If the [`nodeOptions` fuse](../tutorial/fuses.md#nodeoptions) is disabled, `NODE_OPTIONS` will be ignored.
|
||||||
|
|
||||||
### `NODE_EXTRA_CA_CERTS`
|
### `NODE_EXTRA_CA_CERTS`
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ See [Node.js cli documentation](https://github.com/nodejs/node/blob/main/doc/api
|
|||||||
export NODE_EXTRA_CA_CERTS=/path/to/cert.pem
|
export NODE_EXTRA_CA_CERTS=/path/to/cert.pem
|
||||||
```
|
```
|
||||||
|
|
||||||
If the [`nodeOptions` fuse](../tutorial/fuses.md#L27) is disabled, `NODE_EXTRA_CA_CERTS` will be ignored.
|
If the [`nodeOptions` fuse](../tutorial/fuses.md#nodeoptions) is disabled, `NODE_EXTRA_CA_CERTS` will be ignored.
|
||||||
|
|
||||||
### `GOOGLE_API_KEY`
|
### `GOOGLE_API_KEY`
|
||||||
|
|
||||||
@@ -145,16 +145,16 @@ debugging purposes.
|
|||||||
Prints Chromium's internal logging to the console.
|
Prints Chromium's internal logging to the console.
|
||||||
|
|
||||||
Setting this variable is the same as passing `--enable-logging`
|
Setting this variable is the same as passing `--enable-logging`
|
||||||
on the command line. For more info, see `--enable-logging` in [command-line
|
on the command line. For more info, see `--enable-logging` in
|
||||||
switches](./command-line-switches.md#--enable-loggingfile).
|
[command-line switches](./command-line-switches.md#--enable-loggingfile).
|
||||||
|
|
||||||
### `ELECTRON_LOG_FILE`
|
### `ELECTRON_LOG_FILE`
|
||||||
|
|
||||||
Sets the file destination for Chromium's internal logging.
|
Sets the file destination for Chromium's internal logging.
|
||||||
|
|
||||||
Setting this variable is the same as passing `--log-file`
|
Setting this variable is the same as passing `--log-file`
|
||||||
on the command line. For more info, see `--log-file` in [command-line
|
on the command line. For more info, see `--log-file` in
|
||||||
switches](./command-line-switches.md#--log-filepath).
|
[command-line switches](./command-line-switches.md#--log-filepath).
|
||||||
|
|
||||||
### `ELECTRON_DEBUG_NOTIFICATIONS`
|
### `ELECTRON_DEBUG_NOTIFICATIONS`
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
# Chrome Extension Support
|
# Chrome Extension Support
|
||||||
|
|
||||||
Electron supports a subset of the [Chrome Extensions
|
Electron supports a subset of the [Chrome Extensions API][chrome-extensions-api-index],
|
||||||
API][chrome-extensions-api-index], primarily to support DevTools extensions and
|
primarily to support DevTools extensions and Chromium-internal extensions,
|
||||||
Chromium-internal extensions, but it also happens to support some other
|
but it also happens to support some other extension capabilities.
|
||||||
extension capabilities.
|
|
||||||
|
|
||||||
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Emitted when a request has been canceled during an ongoing HTTP transaction.
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
`error` Error - Typically holds an error string identifying failure root cause.
|
* `error` Error - Typically holds an error string identifying failure root cause.
|
||||||
|
|
||||||
Emitted when an error was encountered while streaming response data events. For
|
Emitted when an error was encountered while streaming response data events. For
|
||||||
instance, if the server closes the underlying while the response is still
|
instance, if the server closes the underlying while the response is still
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ Removes all listeners, or those of the specified `channel`.
|
|||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
Send an asynchronous message to the main process via `channel`, along with
|
Send an asynchronous message to the main process via `channel`, along with
|
||||||
arguments. Arguments will be serialized with the [Structured Clone
|
arguments. Arguments will be serialized with the [Structured Clone Algorithm][SCA],
|
||||||
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
|
just like [`window.postMessage`][], so prototype chains will not be
|
||||||
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
||||||
throw an exception.
|
throw an exception.
|
||||||
|
|
||||||
@@ -110,8 +110,8 @@ If you want to receive a single response from the main process, like the result
|
|||||||
Returns `Promise<any>` - Resolves with the response from the main process.
|
Returns `Promise<any>` - Resolves with the response from the main process.
|
||||||
|
|
||||||
Send a message to the main process via `channel` and expect a result
|
Send a message to the main process via `channel` and expect a result
|
||||||
asynchronously. Arguments will be serialized with the [Structured Clone
|
asynchronously. Arguments will be serialized with the [Structured Clone Algorithm][SCA],
|
||||||
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
|
just like [`window.postMessage`][], so prototype chains will not be
|
||||||
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
||||||
throw an exception.
|
throw an exception.
|
||||||
|
|
||||||
@@ -160,8 +160,8 @@ If you do not need a response to the message, consider using [`ipcRenderer.send`
|
|||||||
Returns `any` - The value sent back by the [`ipcMain`](./ipc-main.md) handler.
|
Returns `any` - The value sent back by the [`ipcMain`](./ipc-main.md) handler.
|
||||||
|
|
||||||
Send a message to the main process via `channel` and expect a result
|
Send a message to the main process via `channel` and expect a result
|
||||||
synchronously. Arguments will be serialized with the [Structured Clone
|
synchronously. Arguments will be serialized with the [Structured Clone Algorithm][SCA],
|
||||||
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
|
just like [`window.postMessage`][], so prototype chains will not be
|
||||||
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
||||||
throw an exception.
|
throw an exception.
|
||||||
|
|
||||||
@@ -208,8 +208,8 @@ ipcMain.on('port', (e, msg) => {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information on using `MessagePort` and `MessageChannel`, see the [MDN
|
For more information on using `MessagePort` and `MessageChannel`, see the
|
||||||
documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
|
[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
|
||||||
|
|
||||||
### `ipcRenderer.sendToHost(channel, ...args)`
|
### `ipcRenderer.sendToHost(channel, ...args)`
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ See [`Menu`](menu.md) for examples.
|
|||||||
|
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `click` Function (optional) - Will be called with
|
* `click` Function (optional) - Will be called with
|
||||||
`click(menuItem, browserWindow, event)` when the menu item is clicked.
|
`click(menuItem, window, event)` when the menu item is clicked.
|
||||||
* `menuItem` MenuItem
|
* `menuItem` MenuItem
|
||||||
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
|
* `window` [BaseWindow](base-window.md) | undefined - This will not be defined if no window is open.
|
||||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||||
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
||||||
`click` property will be ignored. See [roles](#roles).
|
`click` property will be ignored. See [roles](#roles).
|
||||||
@@ -146,7 +146,7 @@ A `Function` that is fired when the MenuItem receives a click event.
|
|||||||
It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
|
It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`.
|
||||||
|
|
||||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||||
* `focusedWindow` [BrowserWindow](browser-window.md)
|
* `focusedWindow` [BaseWindow](browser-window.md)
|
||||||
* `focusedWebContents` [WebContents](web-contents.md)
|
* `focusedWebContents` [WebContents](web-contents.md)
|
||||||
|
|
||||||
#### `menuItem.submenu`
|
#### `menuItem.submenu`
|
||||||
|
|||||||
@@ -72,3 +72,7 @@ or is being instructed to use an inverted color scheme.
|
|||||||
|
|
||||||
A `boolean` indicating whether Chromium is in forced colors mode, controlled by system accessibility settings.
|
A `boolean` indicating whether Chromium is in forced colors mode, controlled by system accessibility settings.
|
||||||
Currently, Windows high contrast is the only system setting that triggers forced colors mode.
|
Currently, Windows high contrast is the only system setting that triggers forced colors mode.
|
||||||
|
|
||||||
|
### `nativeTheme.prefersReducedTransparency` _Readonly_
|
||||||
|
|
||||||
|
A `boolean` that indicates the whether the user has chosen via system accessibility settings to reduce transparency at the OS level.
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ requests according to the specified protocol scheme in the `options` object.
|
|||||||
### `net.fetch(input[, init])`
|
### `net.fetch(input[, init])`
|
||||||
|
|
||||||
* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)
|
* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)
|
||||||
* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & { bypassCustomProtocolHandlers?: boolean } (optional)
|
* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & \{ bypassCustomProtocolHandlers?: boolean \} (optional)
|
||||||
|
|
||||||
Returns `Promise<GlobalResponse>` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
Returns `Promise<GlobalResponse>` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
||||||
|
|
||||||
@@ -86,9 +86,8 @@ async function example () {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This method will issue requests from the [default
|
This method will issue requests from the [default session](session.md#sessiondefaultsession).
|
||||||
session](session.md#sessiondefaultsession). To send a `fetch` request from
|
To send a `fetch` request from another session, use [ses.fetch()](session.md#sesfetchinput-init).
|
||||||
another session, use [ses.fetch()](session.md#sesfetchinput-init).
|
|
||||||
|
|
||||||
See the MDN documentation for
|
See the MDN documentation for
|
||||||
[`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) for more
|
[`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) for more
|
||||||
@@ -101,11 +100,10 @@ Limitations:
|
|||||||
* The `.type` and `.url` values of the returned `Response` object are
|
* The `.type` and `.url` values of the returned `Response` object are
|
||||||
incorrect.
|
incorrect.
|
||||||
|
|
||||||
By default, requests made with `net.fetch` can be made to [custom
|
By default, requests made with `net.fetch` can be made to [custom protocols](protocol.md)
|
||||||
protocols](protocol.md) as well as `file:`, and will trigger
|
as well as `file:`, and will trigger [webRequest](web-request.md) handlers if present.
|
||||||
[webRequest](web-request.md) handlers if present. When the non-standard
|
When the non-standard `bypassCustomProtocolHandlers` option is set in RequestInit,
|
||||||
`bypassCustomProtocolHandlers` option is set in RequestInit, custom protocol
|
custom protocol handlers will not be called for this request. This allows forwarding an
|
||||||
handlers will not be called for this request. This allows forwarding an
|
|
||||||
intercepted request to the built-in handler. [webRequest](web-request.md)
|
intercepted request to the built-in handler. [webRequest](web-request.md)
|
||||||
handlers will still be triggered when bypassing custom protocols.
|
handlers will still be triggered when bypassing custom protocols.
|
||||||
|
|
||||||
@@ -167,9 +165,8 @@ will be successful.
|
|||||||
|
|
||||||
Returns [`Promise<ResolvedHost>`](structures/resolved-host.md) - Resolves with the resolved IP addresses for the `host`.
|
Returns [`Promise<ResolvedHost>`](structures/resolved-host.md) - Resolves with the resolved IP addresses for the `host`.
|
||||||
|
|
||||||
This method will resolve hosts from the [default
|
This method will resolve hosts from the [default session](session.md#sessiondefaultsession).
|
||||||
session](session.md#sessiondefaultsession). To resolve a host from
|
To resolve a host from another session, use [ses.resolveHost()](session.md#sesresolvehosthost-options).
|
||||||
another session, use [ses.resolveHost()](session.md#sesresolvehosthost-options).
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,14 @@ An example of implementing a protocol that has the same effect as the
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const { app, protocol, net } = require('electron')
|
const { app, protocol, net } = require('electron')
|
||||||
|
const path = require('node:path')
|
||||||
|
const url = require('node:url')
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
protocol.handle('atom', (request) =>
|
protocol.handle('atom', (request) => {
|
||||||
net.fetch('file://' + request.url.slice('atom://'.length)))
|
const filePath = request.url.slice('atom://'.length)
|
||||||
|
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -42,7 +46,7 @@ app.whenReady().then(() => {
|
|||||||
|
|
||||||
ses.protocol.handle('atom', (request) => {
|
ses.protocol.handle('atom', (request) => {
|
||||||
const filePath = request.url.slice('atom://'.length)
|
const filePath = request.url.slice('atom://'.length)
|
||||||
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
|
return net.fetch(url.pathToFileURL(path.resolve(__dirname, filePath)).toString())
|
||||||
})
|
})
|
||||||
|
|
||||||
const mainWindow = new BrowserWindow({ webPreferences: { partition } })
|
const mainWindow = new BrowserWindow({ webPreferences: { partition } })
|
||||||
@@ -75,9 +79,8 @@ protocol.registerSchemesAsPrivileged([
|
|||||||
])
|
])
|
||||||
```
|
```
|
||||||
|
|
||||||
A standard scheme adheres to what RFC 3986 calls [generic URI
|
A standard scheme adheres to what RFC 3986 calls [generic URI syntax](https://tools.ietf.org/html/rfc3986#section-3).
|
||||||
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
|
For example `http` and `https` are standard schemes, while `file` is not.
|
||||||
`https` are standard schemes, while `file` is not.
|
|
||||||
|
|
||||||
Registering a scheme as standard allows relative and absolute resources to
|
Registering a scheme as standard allows relative and absolute resources to
|
||||||
be resolved correctly when served. Otherwise the scheme will behave like the
|
be resolved correctly when served. Otherwise the scheme will behave like the
|
||||||
|
|||||||
@@ -4,7 +4,19 @@
|
|||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
This module protects data stored on disk from being accessed by other applications or users with full disk access.
|
This module adds extra protection to data being stored on disk by using OS-provided cryptography systems. Current
|
||||||
|
security semantics for each platform are outlined below.
|
||||||
|
|
||||||
|
* **macOS**: Encryption keys are stored for your app in [Keychain Access](https://support.apple.com/en-ca/guide/keychain-access/kyca1083/mac) in a way that prevents
|
||||||
|
other applications from loading them without user override. Therefore, content is protected from other users and other apps running in the same userspace.
|
||||||
|
* **Windows**: Encryption keys are generated via [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata).
|
||||||
|
As per the Windows documentation: "Typically, only a user with the same logon credential as the user who encrypted the data can typically
|
||||||
|
decrypt the data". Therefore, content is protected from other users on the same machine, but not from other apps running in the
|
||||||
|
same userspace.
|
||||||
|
* **Linux**: Encryption keys are generated and stored in a secret store that varies depending on your window manager and system setup. Options currently supported are `kwallet`, `kwallet5`, `kwallet6` and `gnome-libsecret`, but more may be available in future versions of Electron. As such, the
|
||||||
|
security semantics of content protected via the `safeStorage` API vary between window managers and secret stores.
|
||||||
|
* Note that not all Linux setups have an available secret store. If no secret store is available, items stored in using the `safeStorage` API will be unprotected
|
||||||
|
as they are encrypted via hardcoded plaintext password. You can detect when this happens when `safeStorage.getSelectedStorageBackend()` returns `basic_text`.
|
||||||
|
|
||||||
Note that on Mac, access to the system Keychain is required and
|
Note that on Mac, access to the system Keychain is required and
|
||||||
these calls can block the current thread to collect user input.
|
these calls can block the current thread to collect user input.
|
||||||
|
|||||||
@@ -143,6 +143,71 @@ Returns:
|
|||||||
Emitted after an extension is loaded and all necessary browser state is
|
Emitted after an extension is loaded and all necessary browser state is
|
||||||
initialized to support the start of the extension's background page.
|
initialized to support the start of the extension's background page.
|
||||||
|
|
||||||
|
#### Event: 'file-system-access-restricted'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `details` Object
|
||||||
|
* `origin` string - The origin that initiated access to the blocked path.
|
||||||
|
* `isDirectory` boolean - Whether or not the path is a directory.
|
||||||
|
* `path` string - The blocked path attempting to be accessed.
|
||||||
|
* `callback` Function
|
||||||
|
* `action` string - The action to take as a result of the restricted path access attempt.
|
||||||
|
* `allow` - This will allow `path` to be accessed despite restricted status.
|
||||||
|
* `deny` - This will block the access request and trigger an [`AbortError`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort).
|
||||||
|
* `tryAgain` - This will open a new file picker and allow the user to choose another path.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { app, dialog, BrowserWindow, session } = require('electron')
|
||||||
|
|
||||||
|
async function createWindow () {
|
||||||
|
const mainWindow = new BrowserWindow()
|
||||||
|
|
||||||
|
await mainWindow.loadURL('https://buzzfeed.com')
|
||||||
|
|
||||||
|
session.defaultSession.on('file-system-access-restricted', async (e, details, callback) => {
|
||||||
|
const { origin, path } = details
|
||||||
|
const { response } = await dialog.showMessageBox({
|
||||||
|
message: `Are you sure you want ${origin} to open restricted path ${path}?`,
|
||||||
|
title: 'File System Access Restricted',
|
||||||
|
buttons: ['Choose a different folder', 'Allow', 'Cancel'],
|
||||||
|
cancelId: 2
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response === 0) {
|
||||||
|
callback('tryAgain')
|
||||||
|
} else if (response === 1) {
|
||||||
|
callback('allow')
|
||||||
|
} else {
|
||||||
|
callback('deny')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
mainWindow.webContents.executeJavaScript(`
|
||||||
|
window.showDirectoryPicker({
|
||||||
|
id: 'electron-demo',
|
||||||
|
mode: 'readwrite',
|
||||||
|
startIn: 'downloads',
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})`, true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
createWindow()
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) createWindow()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', function () {
|
||||||
|
if (process.platform !== 'darwin') app.quit()
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
#### Event: 'preconnect'
|
#### Event: 'preconnect'
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -430,7 +495,7 @@ app.whenReady().then(() => {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js @ts-nocheck
|
||||||
// Renderer Process
|
// Renderer Process
|
||||||
|
|
||||||
const portConnect = async () => {
|
const portConnect = async () => {
|
||||||
@@ -695,7 +760,7 @@ Returns `Promise<void>` - Resolves when all connections are closed.
|
|||||||
#### `ses.fetch(input[, init])`
|
#### `ses.fetch(input[, init])`
|
||||||
|
|
||||||
* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)
|
* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)
|
||||||
* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & { bypassCustomProtocolHandlers?: boolean } (optional)
|
* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & \{ bypassCustomProtocolHandlers?: boolean \} (optional)
|
||||||
|
|
||||||
Returns `Promise<GlobalResponse>` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
Returns `Promise<GlobalResponse>` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
||||||
|
|
||||||
@@ -729,11 +794,10 @@ Limitations:
|
|||||||
* The `.type` and `.url` values of the returned `Response` object are
|
* The `.type` and `.url` values of the returned `Response` object are
|
||||||
incorrect.
|
incorrect.
|
||||||
|
|
||||||
By default, requests made with `net.fetch` can be made to [custom
|
By default, requests made with `net.fetch` can be made to [custom protocols](protocol.md)
|
||||||
protocols](protocol.md) as well as `file:`, and will trigger
|
as well as `file:`, and will trigger [webRequest](web-request.md) handlers if present.
|
||||||
[webRequest](web-request.md) handlers if present. When the non-standard
|
When the non-standard `bypassCustomProtocolHandlers` option is set in RequestInit,
|
||||||
`bypassCustomProtocolHandlers` option is set in RequestInit, custom protocol
|
custom protocol handlers will not be called for this request. This allows forwarding an
|
||||||
handlers will not be called for this request. This allows forwarding an
|
|
||||||
intercepted request to the built-in handler. [webRequest](web-request.md)
|
intercepted request to the built-in handler. [webRequest](web-request.md)
|
||||||
handlers will still be triggered when bypassing custom protocols.
|
handlers will still be triggered when bypassing custom protocols.
|
||||||
|
|
||||||
@@ -1447,7 +1511,7 @@ Returns `Promise<void>` - resolves when all data has been cleared.
|
|||||||
|
|
||||||
Clears various different types of data.
|
Clears various different types of data.
|
||||||
|
|
||||||
This method clears more types of data and is more thourough than the
|
This method clears more types of data and is more thorough than the
|
||||||
`clearStorageData` method.
|
`clearStorageData` method.
|
||||||
|
|
||||||
**Note:** Cookies are stored at a broader scope than origins. When removing cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be removed at the [registrable domain](https://url.spec.whatwg.org/#host-registrable-domain) level. For example, clearing cookies for the origin `https://really.specific.origin.example.com/` will end up clearing all cookies for `example.com`. Clearing cookies for the origin `https://my.website.example.co.uk/` will end up clearing all cookies for `example.co.uk`.
|
**Note:** Cookies are stored at a broader scope than origins. When removing cookies and filtering by `origins` (or `excludeOrigins`), the cookies will be removed at the [registrable domain](https://url.spec.whatwg.org/#host-registrable-domain) level. For example, clearing cookies for the origin `https://really.specific.origin.example.com/` will end up clearing all cookies for `example.com`. Clearing cookies for the origin `https://my.website.example.co.uk/` will end up clearing all cookies for `example.co.uk`.
|
||||||
|
|||||||
@@ -80,17 +80,21 @@
|
|||||||
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
||||||
* `active` - The backdrop should always appear active.
|
* `active` - The backdrop should always appear active.
|
||||||
* `inactive` - The backdrop should always appear inactive.
|
* `inactive` - The backdrop should always appear inactive.
|
||||||
* `titleBarStyle` string (optional) _macOS_ _Windows_ - The style of window title bar.
|
* `titleBarStyle` string (optional) - The style of window title bar.
|
||||||
Default is `default`. Possible values are:
|
Default is `default`. Possible values are:
|
||||||
* `default` - Results in the standard title bar for macOS or Windows respectively.
|
* `default` - Results in the standard title bar for macOS or Windows respectively.
|
||||||
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
|
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows and Linux, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
|
||||||
* `hiddenInset` _macOS_ - Only on macOS, results in a hidden title bar
|
* `hiddenInset` _macOS_ - Results in a hidden title bar
|
||||||
with an alternative look where the traffic light buttons are slightly
|
with an alternative look where the traffic light buttons are slightly
|
||||||
more inset from the window edge.
|
more inset from the window edge.
|
||||||
* `customButtonsOnHover` _macOS_ - Only on macOS, results in a hidden
|
* `customButtonsOnHover` _macOS_ - Results in a hidden
|
||||||
title bar and a full size content window, the traffic light buttons will
|
title bar and a full size content window, the traffic light buttons will
|
||||||
display when being hovered over in the top left of the window.
|
display when being hovered over in the top left of the window.
|
||||||
**Note:** This option is currently experimental.
|
**Note:** This option is currently experimental.
|
||||||
|
* `titleBarOverlay` Object | Boolean (optional) - When using a frameless window in conjunction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Default is `false`.
|
||||||
|
* `color` String (optional) _Windows_ _Linux_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color.
|
||||||
|
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
|
||||||
|
* `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
||||||
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
||||||
Set a custom position for the traffic light buttons in frameless windows.
|
Set a custom position for the traffic light buttons in frameless windows.
|
||||||
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
|
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
|
||||||
@@ -150,3 +154,6 @@ Possible values are:
|
|||||||
reserved for NSPanel, at runtime. Also, the window will appear on all
|
reserved for NSPanel, at runtime. Also, the window will appear on all
|
||||||
spaces (desktops).
|
spaces (desktops).
|
||||||
* On Windows, possible type is `toolbar`.
|
* On Windows, possible type is `toolbar`.
|
||||||
|
|
||||||
|
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||||
|
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||||
|
|||||||
@@ -2,10 +2,3 @@
|
|||||||
|
|
||||||
* `webPreferences` [WebPreferences](web-preferences.md?inline) (optional) - Settings of web page's features.
|
* `webPreferences` [WebPreferences](web-preferences.md?inline) (optional) - Settings of web page's features.
|
||||||
* `paintWhenInitiallyHidden` boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
* `paintWhenInitiallyHidden` boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
||||||
* `titleBarOverlay` Object | Boolean (optional) - When using a frameless window in conjunction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Default is `false`.
|
|
||||||
* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color.
|
|
||||||
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
|
|
||||||
* `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
|
||||||
|
|
||||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
|
||||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
contain the layout of the document—without requiring scrolling. Enabling
|
contain the layout of the document—without requiring scrolling. Enabling
|
||||||
this will cause the `preferred-size-changed` event to be emitted on the
|
this will cause the `preferred-size-changed` event to be emitted on the
|
||||||
`WebContents` when the preferred size changes. Default is `false`.
|
`WebContents` when the preferred size changes. Default is `false`.
|
||||||
|
* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
|
||||||
|
|
||||||
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
|
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
|
||||||
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
|
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
> Get system preferences.
|
> Get system preferences.
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process), [Utility](../glossary.md#utility-process)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { systemPreferences } = require('electron')
|
const { systemPreferences } = require('electron')
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ updates the control in the touch bar. Possible values:
|
|||||||
|
|
||||||
#### `touchBarScrubber.overlayStyle`
|
#### `touchBarScrubber.overlayStyle`
|
||||||
|
|
||||||
A `string` representing the style that selected items in the scrubber should have. This style is overlayed on top
|
A `string` representing the style that selected items in the scrubber should have. This style is overlaid on top
|
||||||
of the scrubber item instead of being placed behind it. Updating this value immediately updates the control in the
|
of the scrubber item instead of being placed behind it. Updating this value immediately updates the control in the
|
||||||
touch bar. Possible values:
|
touch bar. Possible values:
|
||||||
|
|
||||||
|
|||||||
@@ -48,10 +48,15 @@ Objects created with `new View` have the following instance methods:
|
|||||||
* `index` Integer (optional) - Index at which to insert the child view.
|
* `index` Integer (optional) - Index at which to insert the child view.
|
||||||
Defaults to adding the child at the end of the child list.
|
Defaults to adding the child at the end of the child list.
|
||||||
|
|
||||||
|
If the same View is added to a parent which already contains it, it will be reordered such that
|
||||||
|
it becomes the topmost view.
|
||||||
|
|
||||||
#### `view.removeChildView(view)`
|
#### `view.removeChildView(view)`
|
||||||
|
|
||||||
* `view` View - Child view to remove.
|
* `view` View - Child view to remove.
|
||||||
|
|
||||||
|
If the view passed as a parameter is not a child of this view, this method is a no-op.
|
||||||
|
|
||||||
#### `view.setBounds(bounds)`
|
#### `view.setBounds(bounds)`
|
||||||
|
|
||||||
* `bounds` [Rectangle](structures/rectangle.md) - New bounds of the View.
|
* `bounds` [Rectangle](structures/rectangle.md) - New bounds of the View.
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ Process: [Main](../glossary.md#main-process)
|
|||||||
|
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `webPreferences` [WebPreferences](structures/web-preferences.md) (optional) - Settings of web page's features.
|
* `webPreferences` [WebPreferences](structures/web-preferences.md) (optional) - Settings of web page's features.
|
||||||
|
* `webContents` [WebContents](web-contents.md) (optional) - If present, the given WebContents will be adopted by the WebContentsView. A WebContents may only be presented in one WebContentsView at a time.
|
||||||
|
|
||||||
Creates an empty WebContentsView.
|
Creates a WebContentsView.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
|
|||||||
@@ -617,8 +617,7 @@ Returns:
|
|||||||
|
|
||||||
Emitted when failed to verify the `certificate` for `url`.
|
Emitted when failed to verify the `certificate` for `url`.
|
||||||
|
|
||||||
The usage is the same with [the `certificate-error` event of
|
The usage is the same with [the `certificate-error` event of `app`](app.md#event-certificate-error).
|
||||||
`app`](app.md#event-certificate-error).
|
|
||||||
|
|
||||||
#### Event: 'select-client-certificate'
|
#### Event: 'select-client-certificate'
|
||||||
|
|
||||||
@@ -632,8 +631,7 @@ Returns:
|
|||||||
|
|
||||||
Emitted when a client certificate is requested.
|
Emitted when a client certificate is requested.
|
||||||
|
|
||||||
The usage is the same with [the `select-client-certificate` event of
|
The usage is the same with [the `select-client-certificate` event of `app`](app.md#event-select-client-certificate).
|
||||||
`app`](app.md#event-select-client-certificate).
|
|
||||||
|
|
||||||
#### Event: 'login'
|
#### Event: 'login'
|
||||||
|
|
||||||
@@ -1850,8 +1848,8 @@ Opens the developer tools for the service worker context.
|
|||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
Send an asynchronous message to the renderer process via `channel`, along with
|
Send an asynchronous message to the renderer process via `channel`, along with
|
||||||
arguments. Arguments will be serialized with the [Structured Clone
|
arguments. Arguments will be serialized with the [Structured Clone Algorithm][SCA],
|
||||||
Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
|
just like [`postMessage`][], so prototype chains will not be
|
||||||
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
||||||
throw an exception.
|
throw an exception.
|
||||||
|
|
||||||
|
|||||||
@@ -103,10 +103,9 @@ Returns `boolean` - Whether the reload was initiated successfully. Only results
|
|||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
Send an asynchronous message to the renderer process via `channel`, along with
|
Send an asynchronous message to the renderer process via `channel`, along with
|
||||||
arguments. Arguments will be serialized with the [Structured Clone
|
arguments. Arguments will be serialized with the [Structured Clone Algorithm][SCA],
|
||||||
Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
|
just like [`postMessage`][], so prototype chains will not be included.
|
||||||
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
|
Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.
|
||||||
throw an exception.
|
|
||||||
|
|
||||||
The renderer process can handle the message by listening to `channel` with the
|
The renderer process can handle the message by listening to `channel` with the
|
||||||
[`ipcRenderer`](ipc-renderer.md) module.
|
[`ipcRenderer`](ipc-renderer.md) module.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ The `webUtils` module has the following methods:
|
|||||||
|
|
||||||
Returns `string` - The file system path that this `File` object points to. In the case where the object passed in is not a `File` object an exception is thrown. In the case where the File object passed in was constructed in JS and is not backed by a file on disk an empty string is returned.
|
Returns `string` - The file system path that this `File` object points to. In the case where the object passed in is not a `File` object an exception is thrown. In the case where the File object passed in was constructed in JS and is not backed by a file on disk an empty string is returned.
|
||||||
|
|
||||||
This method superceded the previous augmentation to the `File` object with the `path` property. An example is included below.
|
This method superseded the previous augmentation to the `File` object with the `path` property. An example is included below.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Before
|
// Before
|
||||||
|
|||||||
@@ -221,9 +221,7 @@ windows. Popups are disabled by default.
|
|||||||
```
|
```
|
||||||
|
|
||||||
A `string` which is a comma separated list of strings which specifies the web preferences to be set on the webview.
|
A `string` which is a comma separated list of strings which specifies the web preferences to be set on the webview.
|
||||||
The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions). In addition, webview supports the following preferences:
|
The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions).
|
||||||
|
|
||||||
* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
|
|
||||||
|
|
||||||
The string follows the same format as the features string in `window.open`.
|
The string follows the same format as the features string in `window.open`.
|
||||||
A name by itself is given a `true` boolean value.
|
A name by itself is given a `true` boolean value.
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ This document uses the following convention to categorize breaking changes:
|
|||||||
|
|
||||||
## Planned Breaking API Changes (31.0)
|
## Planned Breaking API Changes (31.0)
|
||||||
|
|
||||||
|
### Removed: `WebSQL` support
|
||||||
|
|
||||||
|
Chromium has removed support for WebSQL upstream, transitioning it to Android only. See
|
||||||
|
[Chromium's intent to remove discussion](https://groups.google.com/a/chromium.org/g/blink-dev/c/fWYb6evVA-w/m/wGI863zaAAAJ)
|
||||||
|
for more information.
|
||||||
|
|
||||||
### Behavior Changed: `nativeImage.toDataURL` will preseve PNG colorspace
|
### Behavior Changed: `nativeImage.toDataURL` will preseve PNG colorspace
|
||||||
|
|
||||||
PNG decoder implementation has been changed to preserve colorspace data, the
|
PNG decoder implementation has been changed to preserve colorspace data, the
|
||||||
@@ -678,8 +684,8 @@ document.getElementById('webview').addEventListener('new-window', () => {
|
|||||||
### Deprecated: BrowserWindow `scroll-touch-*` events
|
### Deprecated: BrowserWindow `scroll-touch-*` events
|
||||||
|
|
||||||
The `scroll-touch-begin`, `scroll-touch-end` and `scroll-touch-edge` events on
|
The `scroll-touch-begin`, `scroll-touch-end` and `scroll-touch-edge` events on
|
||||||
BrowserWindow are deprecated. Instead, use the newly available [`input-event`
|
BrowserWindow are deprecated. Instead, use the newly available
|
||||||
event](api/web-contents.md#event-input-event) on WebContents.
|
[`input-event` event](api/web-contents.md#event-input-event) on WebContents.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Deprecated
|
// Deprecated
|
||||||
@@ -704,8 +710,8 @@ win.webContents.on('input-event', (_, event) => {
|
|||||||
### Behavior Changed: V8 Memory Cage enabled
|
### Behavior Changed: V8 Memory Cage enabled
|
||||||
|
|
||||||
The V8 memory cage has been enabled, which has implications for native modules
|
The V8 memory cage has been enabled, which has implications for native modules
|
||||||
which wrap non-V8 memory with `ArrayBuffer` or `Buffer`. See the [blog post
|
which wrap non-V8 memory with `ArrayBuffer` or `Buffer`. See the
|
||||||
about the V8 memory cage](https://www.electronjs.org/blog/v8-memory-cage) for
|
[blog post about the V8 memory cage](https://www.electronjs.org/blog/v8-memory-cage) for
|
||||||
more details.
|
more details.
|
||||||
|
|
||||||
### API Changed: `webContents.printToPDF()`
|
### API Changed: `webContents.printToPDF()`
|
||||||
@@ -1307,8 +1313,7 @@ const w = new BrowserWindow({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
We [recommend moving away from the remote
|
We [recommend moving away from the remote module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
||||||
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
|
||||||
|
|
||||||
### `protocol.unregisterProtocol`
|
### `protocol.unregisterProtocol`
|
||||||
|
|
||||||
@@ -1468,12 +1473,11 @@ You can see the original API proposal and reasoning [here](https://github.com/el
|
|||||||
|
|
||||||
### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
|
### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
|
||||||
|
|
||||||
The algorithm used to serialize objects sent over IPC (through
|
The algorithm used to serialize objects sent over IPC (through `ipcRenderer.send`,
|
||||||
`ipcRenderer.send`, `ipcRenderer.sendSync`, `WebContents.send` and related
|
`ipcRenderer.sendSync`, `WebContents.send` and related methods) has been switched from a custom
|
||||||
methods) has been switched from a custom algorithm to V8's built-in [Structured
|
algorithm to V8's built-in [Structured Clone Algorithm][SCA], the same algorithm used to serialize
|
||||||
Clone Algorithm][SCA], the same algorithm used to serialize messages for
|
messages for `postMessage`. This brings about a 2x performance improvement for large messages,
|
||||||
`postMessage`. This brings about a 2x performance improvement for large
|
but also brings some breaking changes in behavior.
|
||||||
messages, but also brings some breaking changes in behavior.
|
|
||||||
|
|
||||||
* Sending Functions, Promises, WeakMaps, WeakSets, or objects containing any
|
* Sending Functions, Promises, WeakMaps, WeakSets, or objects containing any
|
||||||
such values, over IPC will now throw an exception, instead of silently
|
such values, over IPC will now throw an exception, instead of silently
|
||||||
@@ -1980,8 +1984,8 @@ app.getGPUInfo('basic')
|
|||||||
When building native modules for windows, the `win_delay_load_hook` variable in
|
When building native modules for windows, the `win_delay_load_hook` variable in
|
||||||
the module's `binding.gyp` must be true (which is the default). If this hook is
|
the module's `binding.gyp` must be true (which is the default). If this hook is
|
||||||
not present, then the native module will fail to load on Windows, with an error
|
not present, then the native module will fail to load on Windows, with an error
|
||||||
message like `Cannot find module`. See the [native module
|
message like `Cannot find module`.
|
||||||
guide](./tutorial/using-native-node-modules.md) for more.
|
See the [native module guide](./tutorial/using-native-node-modules.md) for more.
|
||||||
|
|
||||||
### Removed: IA32 Linux support
|
### Removed: IA32 Linux support
|
||||||
|
|
||||||
|
|||||||
@@ -110,22 +110,51 @@ $ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
|
|||||||
On Windows:
|
On Windows:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# cmd
|
||||||
$ cd src
|
$ cd src
|
||||||
$ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools
|
$ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools
|
||||||
|
|
||||||
|
# PowerShell
|
||||||
|
$ cd src
|
||||||
|
$ $env:CHROMIUM_BUILDTOOLS_PATH = "$(Get-Location)\buildtools"
|
||||||
```
|
```
|
||||||
|
|
||||||
**To generate Testing build config of Electron:**
|
**To generate Testing build config of Electron:**
|
||||||
|
|
||||||
|
On Linux & MacOS
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
|
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On Windows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# cmd
|
||||||
|
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
|
||||||
|
|
||||||
|
# PowerShell
|
||||||
|
gn gen out/Testing --args="import(\`"//electron/build/args/testing.gn\`")"
|
||||||
|
```
|
||||||
|
|
||||||
**To generate Release build config of Electron:**
|
**To generate Release build config of Electron:**
|
||||||
|
|
||||||
|
On Linux & MacOS
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
|
$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On Windows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# cmd
|
||||||
|
$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
|
||||||
|
|
||||||
|
# PowerShell
|
||||||
|
$ gn gen out/Release --args="import(\`"//electron/build/args/release.gn\`")"
|
||||||
|
```
|
||||||
|
|
||||||
**Note:** This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
|
**Note:** This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
|
||||||
|
|
||||||
Also you shouldn't have to run `gn gen` again—if you want to change the build arguments, you can run `gn args out/Testing` to bring up an editor. To see the list of available build configuration options, run `gn args out/Testing --list`.
|
Also you shouldn't have to run `gn gen` again—if you want to change the build arguments, you can run `gn args out/Testing` to bring up an editor. To see the list of available build configuration options, run `gn args out/Testing --list`.
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ You can run `npm run lint` to show any style issues detected by `cpplint` and
|
|||||||
|
|
||||||
## C++ and Python
|
## C++ and Python
|
||||||
|
|
||||||
For C++ and Python, we follow Chromium's [Coding
|
For C++ and Python, we follow Chromium's
|
||||||
Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/styleguide.md).
|
[Coding Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/styleguide.md).
|
||||||
There is also a script `script/cpplint.py` to check whether all files conform.
|
There is also a script `script/cpplint.py` to check whether all files conform.
|
||||||
|
|
||||||
The Python version we are using now is Python 3.9.
|
The Python version we are using now is Python 3.9.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ calls, and other compiler optimizations. The only workaround is to build an
|
|||||||
unoptimized local build.
|
unoptimized local build.
|
||||||
|
|
||||||
The official symbol server URL for Electron is
|
The official symbol server URL for Electron is
|
||||||
<https://symbols.electronjs.org>.
|
[https://symbols.electronjs.org](https://symbols.electronjs.org).
|
||||||
You cannot visit this URL directly, you must add it to the symbol path of your
|
You cannot visit this URL directly, you must add it to the symbol path of your
|
||||||
debugging tool. In the examples below, a local cache directory is used to avoid
|
debugging tool. In the examples below, a local cache directory is used to avoid
|
||||||
repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an
|
repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
The source code of Electron is separated into a few parts, mostly
|
The source code of Electron is separated into a few parts, mostly
|
||||||
following Chromium on the separation conventions.
|
following Chromium on the separation conventions.
|
||||||
|
|
||||||
You may need to become familiar with [Chromium's multi-process
|
You may need to become familiar with
|
||||||
architecture](https://dev.chromium.org/developers/design-documents/multi-process-architecture)
|
[Chromium's multi-process architecture](https://dev.chromium.org/developers/design-documents/multi-process-architecture)
|
||||||
to understand the source code better.
|
to understand the source code better.
|
||||||
|
|
||||||
## Structure of Source Code
|
## Structure of Source Code
|
||||||
@@ -78,8 +78,7 @@ Electron
|
|||||||
|
|
||||||
## Structure of Other Directories
|
## Structure of Other Directories
|
||||||
|
|
||||||
* **.circleci** - Config file for CI with CircleCI.
|
* **.github** - GitHub-specific config files including issues templates, CI with GitHub Actions and CODEOWNERS.
|
||||||
* **.github** - GitHub-specific config files including issues templates and CODEOWNERS.
|
|
||||||
* **dist** - Temporary directory created by `script/create-dist.py` script
|
* **dist** - Temporary directory created by `script/create-dist.py` script
|
||||||
when creating a distribution.
|
when creating a distribution.
|
||||||
* **node_modules** - Third party node modules used for building.
|
* **node_modules** - Third party node modules used for building.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<button id="clickme">Test Bluetooth</button>
|
<button id="clickme">Test Bluetooth</button>
|
||||||
<button id="cancel">Cancel Bluetooth Request</button>
|
<button id="cancel">Cancel Bluetooth Request</button>
|
||||||
|
|
||||||
<p>Currently selected bluetooth device: <strong id="device-name""></strong></p>
|
<p>Currently selected bluetooth device: <strong id="device-name"></strong></p>
|
||||||
|
|
||||||
<script src="./renderer.js"></script>
|
<script src="./renderer.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ of the most powerful utilities in any Electron Developer's tool belt.
|
|||||||
## Main Process
|
## Main Process
|
||||||
|
|
||||||
Debugging the main process is a bit trickier, since you cannot open
|
Debugging the main process is a bit trickier, since you cannot open
|
||||||
developer tools for them. The Chromium Developer Tools can [be used
|
developer tools for them. The Chromium Developer Tools can
|
||||||
to debug Electron's main process][node-inspect] thanks to a closer collaboration
|
[be used to debug Electron's main process][node-inspect] thanks to a closer collaboration
|
||||||
between Google / Chrome and Node.js, but you might encounter oddities like
|
between Google / Chrome and Node.js, but you might encounter oddities like
|
||||||
`require` not being present in the console.
|
`require` not being present in the console.
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ If you prefer the manual approach, there are 2 ways to distribute your applicati
|
|||||||
|
|
||||||
### With prebuilt binaries
|
### With prebuilt binaries
|
||||||
|
|
||||||
To distribute your app manually, you need to download Electron's [prebuilt
|
To distribute your app manually, you need to download Electron's
|
||||||
binaries](https://github.com/electron/electron/releases). Next, the folder
|
[prebuilt binaries](https://github.com/electron/electron/releases). Next, the folder
|
||||||
containing your app should be named `app` and placed in Electron's resources
|
containing your app should be named `app` and placed in Electron's resources
|
||||||
directory as shown in the following examples.
|
directory as shown in the following examples.
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user