Skip to content

Commit 1cb466f

Browse files
committed
update dependencies, add arm64 build
1 parent 318f10f commit 1cb466f

File tree

2 files changed

+29
-35
lines changed

2 files changed

+29
-35
lines changed

.github/workflows/rebuildElectron.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ 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
@@ -44,7 +43,6 @@ jobs:
4443
CXX: clang++
4544
npm_config_clang: 1
4645
GYP_DEFINES: use_obsolete_asm=true
47-
BUILD_ONLY: true
4846
electron_npg_automator_module: nodegit/nodegit
4947
electron_npg_automator_use_git_clone: true
5048
- run: node ci/deploy.js
@@ -57,18 +55,16 @@ jobs:
5755
CXX: clang++
5856
npm_config_clang: 1
5957
GYP_DEFINES: use_obsolete_asm=true
60-
BUILD_ONLY: true
6158
electron_npg_automator_module: nodegit/nodegit
6259
electron_npg_automator_use_git_clone: true
6360

6461
rebuild-windows:
6562
name: Rebuild Windows
6663
strategy:
6764
matrix:
68-
os: [windows-2022]
69-
arch: [x64]
65+
arch: [x64, arm64]
7066
fail-fast: false
71-
runs-on: ${{ matrix.os }}
67+
runs-on: windows-latest
7268
steps:
7369
- name: Print Tag Ref
7470
run: echo ${{ github.ref }}
@@ -96,39 +92,39 @@ jobs:
9692
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
9793
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
9894
GYP_DEFINES: use_obsolete_asm=true
99-
BUILD_ONLY: true
10095
electron_npg_automator_module: nodegit/nodegit
10196
electron_npg_automator_use_git_clone: true
97+
TARGET_ARCH: ${{ matrix.arch }}
10298
- run: node ci/deploy.js
10399
env:
104100
electron_npg_automator_gh_token: ${{ secrets.electron_npg_automator_gh_token }}
105101
node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }}
106102
AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }}
107103
AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }}
108104
GYP_DEFINES: use_obsolete_asm=true
109-
BUILD_ONLY: true
110105
electron_npg_automator_module: nodegit/nodegit
111106
electron_npg_automator_use_git_clone: true
107+
TARGET_ARCH: ${{ matrix.arch }}
112108

113109
rebuild-macos:
114110
name: Rebuild macOS
115111
strategy:
116112
matrix:
117113
arch: [x64, arm64]
118114
fail-fast: false
119-
runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
115+
runs-on: ${{ matrix.arch == 'x64' && 'macos-15-intel' || 'macos-15' }}
120116
steps:
121117
- name: Print Tag Ref
122118
run: echo ${{ github.ref }}
123119

124120
- uses: actions/checkout@v4
125121

126-
- name: Use Node.js 20
122+
- name: Use Node.js 22
127123
uses: actions/setup-node@v4
128124
env:
129125
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
130126
with:
131-
node-version: 20
127+
node-version: 22
132128
architecture: ${{ matrix.arch }}
133129

134130
- name: Use Python 3.11 # node-gyp < 10 breaks with 3.12
@@ -147,7 +143,6 @@ jobs:
147143
CXX: clang++
148144
npm_config_clang: 1
149145
GYP_DEFINES: use_obsolete_asm=true
150-
BUILD_ONLY: true
151146
electron_npg_automator_module: nodegit/nodegit
152147
electron_npg_automator_use_git_clone: true
153148
- run: node ci/deploy.js
@@ -160,6 +155,5 @@ jobs:
160155
CXX: clang++
161156
npm_config_clang: 1
162157
GYP_DEFINES: use_obsolete_asm=true
163-
BUILD_ONLY: true
164158
electron_npg_automator_module: nodegit/nodegit
165159
electron_npg_automator_use_git_clone: true

ci/build.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
const cp = require('child_process');
2-
const fs = require('fs');
2+
const getTagInfo = require('../util/get-tag-info');
3+
const modulePath = require('../util/module-path');
4+
const moduleParentPath = require('../util/module-parent-path');
35
const path = require('path');
6+
const {installNodeHeaders, rebuildNativeModules} = require('electron-rebuild');
47

5-
module.exports = function(electronVersion, moduleParentPath, modulePath) {
8+
function build (electronVersion, moduleParentPath, modulePath) {
69
return new Promise(function(resolve, reject) {
710
let npmrc = 'runtime = electron\n';
811
npmrc += 'disturl = https://electronjs.org/headers\n';
912
npmrc += `target = ${electronVersion.replace('v', '')}`;
13+
if (process.env.TARGET_ARCH) {
14+
npmrc += `\ntarget_arch = ${process.env.TARGET_ARCH}`;
15+
}
1016

1117
fs.writeFileSync(path.join(modulePath, '.npmrc'), npmrc);
1218

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-
}
30-
3119
const spawnedNPM = cp.spawn(
3220
'npm',
3321
['install'],
@@ -45,3 +33,15 @@ module.exports = function(electronVersion, moduleParentPath, modulePath) {
4533
})
4634
});
4735
};
36+
37+
getTagInfo()
38+
.then(({electronVersion}) => {
39+
electronVersion = electronVersion.replace('v', '');
40+
41+
return build(electronVersion, moduleParentPath(), modulePath());
42+
})
43+
.catch (e => {
44+
console.error('Error building:');
45+
console.error(e);
46+
process.exit(1);
47+
});

0 commit comments

Comments
 (0)