Skip to content

Commit 63dd31f

Browse files
committed
update dependencies, combine steps, add windows-arm64 build
1 parent bc10a89 commit 63dd31f

File tree

3 files changed

+45
-114
lines changed

3 files changed

+45
-114
lines changed

.github/workflows/rebuildElectron.yml

Lines changed: 20 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@ jobs:
1717
run: echo ${{ github.ref }}
1818

1919
- name: Install Dependencies for Ubuntu
20-
# git >= 2.18 required for actions/checkout git support
2120
run: apt update && apt install -y software-properties-common git wget build-essential clang python3 libkrb5-dev libc++-dev zlib1g-dev libssl-dev
2221
env:
2322
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
2423

2524
- uses: actions/checkout@v4
2625

27-
- name: Use Node.js 20
26+
- name: Use Node.js 22
2827
uses: actions/setup-node@v4
2928
env:
3029
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3130
with:
32-
node-version: 20
31+
node-version: 22
3332
architecture: ${{ matrix.arch }}
3433

3534
- run: git config --global --add safe.directory /__w/electron-npg-automator/electron-npg-automator
3635
- run: npm install
37-
- run: node ci/build.js
36+
- name: Build & Deploy
3837
env:
3938
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
4039
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
@@ -44,31 +43,19 @@ jobs:
4443
CXX: clang++
4544
npm_config_clang: 1
4645
GYP_DEFINES: use_obsolete_asm=true
47-
BUILD_ONLY: true
48-
electron_npg_automator_module: nodegit/nodegit
49-
electron_npg_automator_use_git_clone: true
50-
- run: node ci/deploy.js
51-
env:
52-
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
53-
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
54-
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
55-
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
56-
CC: clang
57-
CXX: clang++
58-
npm_config_clang: 1
59-
GYP_DEFINES: use_obsolete_asm=true
60-
BUILD_ONLY: true
6146
electron_npg_automator_module: nodegit/nodegit
6247
electron_npg_automator_use_git_clone: true
48+
run: |
49+
node ci/build.js
50+
node ci/deploy.js
6351
6452
rebuild-windows:
6553
name: Rebuild Windows
6654
strategy:
6755
matrix:
68-
os: [windows-2022]
69-
arch: [x64]
56+
arch: [x64, arm64]
7057
fail-fast: false
71-
runs-on: ${{ matrix.os }}
58+
runs-on: windows-latest
7259
steps:
7360
- name: Print Tag Ref
7461
run: echo ${{ github.ref }}
@@ -81,76 +68,54 @@ jobs:
8168
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
8269
with:
8370
node-version: 22
84-
architecture: ${{ matrix.arch }}
8571

8672
- name: Use Python 3.11 # node-gyp < 10 breaks with 3.12
8773
uses: actions/setup-python@v4
8874
with:
8975
python-version: '3.11'
9076

9177
- run: npm install
92-
- run: node ci/build.js
78+
- name: Build & Deploy
9379
env:
9480
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
9581
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
9682
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
9783
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
9884
GYP_DEFINES: use_obsolete_asm=true
99-
BUILD_ONLY: true
100-
electron_npg_automator_module: nodegit/nodegit
101-
electron_npg_automator_use_git_clone: true
102-
- run: node ci/deploy.js
103-
env:
104-
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
105-
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
106-
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
107-
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
108-
GYP_DEFINES: use_obsolete_asm=true
109-
BUILD_ONLY: true
11085
electron_npg_automator_module: nodegit/nodegit
11186
electron_npg_automator_use_git_clone: true
87+
TARGET_ARCH: ${{ matrix.arch }}
88+
run: |
89+
node ci/build.js
90+
node ci/deploy.js
11291
11392
rebuild-macos:
11493
name: Rebuild macOS
11594
strategy:
11695
matrix:
11796
arch: [x64, arm64]
11897
fail-fast: false
119-
runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
98+
runs-on: ${{ matrix.arch == 'x64' && 'macos-15-intel' || 'macos-15' }}
12099
steps:
121100
- name: Print Tag Ref
122101
run: echo ${{ github.ref }}
123102

124103
- uses: actions/checkout@v4
125104

126-
- name: Use Node.js 20
105+
- name: Use Node.js 22
127106
uses: actions/setup-node@v4
128107
env:
129108
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
130109
with:
131-
node-version: 20
132-
architecture: ${{ matrix.arch }}
110+
node-version: 22
133111

134112
- name: Use Python 3.11 # node-gyp < 10 breaks with 3.12
135113
uses: actions/setup-python@v4
136114
with:
137115
python-version: '3.11'
138116

139117
- run: npm install
140-
- run: node ci/build.js
141-
env:
142-
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
143-
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
144-
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
145-
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
146-
CC: clang
147-
CXX: clang++
148-
npm_config_clang: 1
149-
GYP_DEFINES: use_obsolete_asm=true
150-
BUILD_ONLY: true
151-
electron_npg_automator_module: nodegit/nodegit
152-
electron_npg_automator_use_git_clone: true
153-
- run: node ci/deploy.js
118+
- name: Build & Deploy
154119
env:
155120
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
156121
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
@@ -160,6 +125,8 @@ jobs:
160125
CXX: clang++
161126
npm_config_clang: 1
162127
GYP_DEFINES: use_obsolete_asm=true
163-
BUILD_ONLY: true
164128
electron_npg_automator_module: nodegit/nodegit
165129
electron_npg_automator_use_git_clone: true
130+
run: |
131+
node ci/build.js
132+
node ci/deploy.js

ci/build.js

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,36 @@
1+
const fs = require('fs/promises');
12
const cp = require('child_process');
2-
const fs = require('fs');
3+
const getTagInfo = require('../util/get-tag-info');
4+
const modulePath = require('../util/module-path');
35
const path = require('path');
6+
const downloadModule = require('../util/download-module');
47

5-
module.exports = function(electronVersion, moduleParentPath, modulePath) {
6-
return new Promise(function(resolve, reject) {
7-
let npmrc = 'runtime = electron\n';
8-
npmrc += 'disturl = https://electronjs.org/headers\n';
9-
npmrc += `target = ${electronVersion.replace('v', '')}`;
8+
(async () => {
9+
await downloadModule();
10+
11+
const tagInfo = await getTagInfo();
12+
const electronVersion = tagInfo.electronVersion.replace('v', '');
1013

11-
fs.writeFileSync(path.join(modulePath, '.npmrc'), npmrc);
14+
let npmrc = 'runtime = electron\n';
15+
npmrc += 'disturl = https://electronjs.org/headers\n';
16+
npmrc += `target = ${electronVersion.replace('v', '')}`;
17+
if (process.env.TARGET_ARCH) {
18+
npmrc += `\narch = ${process.env.TARGET_ARCH}`;
19+
}
1220

13-
if (process.platform === 'win32') {
14-
cp.exec(
15-
'npm install',
16-
{cwd: modulePath, maxBuffer: Number.MAX_VALUE},
17-
function(err, stdout, stderr) {
18-
console.log(stdout);
19-
console.error(stderr);
20-
if (err) {
21-
reject(err);
22-
}
23-
else {
24-
resolve();
25-
}
26-
}
27-
);
28-
return;
29-
}
21+
await fs.writeFile(path.join(modulePath(), '.npmrc'), npmrc);
3022

23+
return new Promise(function(resolve, reject) {
3124
const spawnedNPM = cp.spawn(
32-
'npm',
33-
['install'],
34-
{ cwd: modulePath }
25+
'npm install',
26+
{
27+
cwd: modulePath(),
28+
shell: true
29+
}
3530
);
3631

37-
spawnedNPM.stdout.on('data', data => console.log(data && data.toString().trim()));
38-
spawnedNPM.stderr.on('data', data => console.log(data && data.toString().trim()));
32+
spawnedNPM.stdout.on('data', data => console.log(data && data.toString()));
33+
spawnedNPM.stderr.on('data', data => console.log(data && data.toString()));
3934
spawnedNPM.on('close', (code) => {
4035
if (code === 0) {
4136
resolve();
@@ -44,4 +39,4 @@ module.exports = function(electronVersion, moduleParentPath, modulePath) {
4439
}
4540
})
4641
});
47-
};
42+
})();

ci/prepare.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)