Skip to content

Commit 2f59e79

Browse files
authored
Merge pull request #285 from desktop/upgrade-all-the-things
Upgrade a few dependencies
2 parents 3a58017 + 1681129 commit 2f59e79

File tree

5 files changed

+724
-497
lines changed

5 files changed

+724
-497
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ on:
1111
jobs:
1212
build:
1313
name: Build
14-
runs-on: windows-2019
14+
runs-on: windows-2022
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [windows-2019]
18+
os: [windows-2022]
1919
include:
20-
- os: windows-2019
20+
- os: windows-2022
2121
friendlyName: Windows
2222
timeout-minutes: 10
2323
steps:
@@ -27,16 +27,7 @@ jobs:
2727
- name: Install Node.js
2828
uses: actions/[email protected]
2929
with:
30-
node-version: 18
31-
32-
# This step can be removed as soon as official Windows arm64 builds are published:
33-
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342
34-
- run: |
35-
$NodeVersion = (node --version) -replace '^.'
36-
$NodeFallbackVersion = "15.8.0"
37-
& .\script\download-node-lib-win-arm64.ps1 $NodeVersion $NodeFallbackVersion
38-
name: Install Windows arm64 node.lib
39-
30+
node-version: 22.14.0
4031
- name: Install and build dependencies
4132
run: yarn
4233
- name: Lint

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
"devDependencies": {
3535
"@types/benchmark": "^1.0.31",
3636
"@types/jest": "^26.0.13",
37-
"@types/node": "^12.0.0",
37+
"@types/node": "^22.10.9",
3838
"benchmark": "^2.1.4",
3939
"jest": "^26.4.2",
40-
"node-abi": "^2.21.0",
40+
"node-abi": "^4.9.0",
4141
"node-gyp": "^11.2.0",
42-
"prebuild": "^10.0.1",
42+
"prebuild": "^13.0.1",
4343
"prettier": "^2.0.5",
4444
"ts-node": "^9.0.0",
45-
"typescript": "^3.9.0"
45+
"typescript": "^5.8.2"
4646
},
4747
"dependencies": {
48-
"node-addon-api": "^3.2.1",
49-
"prebuild-install": "^5.3.5"
48+
"node-addon-api": "^8.3.1",
49+
"prebuild-install": "^7.1.3"
5050
},
5151
"binary": {
5252
"napi_versions": [

script/download-node-lib-win-arm64.ps1

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

script/upload.js

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,49 @@
11
// to ensure that env not in the CI server log
22

33
const path = require('path')
4+
const fs = require('fs')
45
const { spawnSync } = require('child_process')
56

6-
spawnSync(
7-
path.join(
7+
// Make sure output of the script is logged to the console and also the error is
8+
// caught and logged.
9+
if (!process.env.GITHUB_AUTH_TOKEN) {
10+
console.error(
11+
'GITHUB_AUTH_TOKEN is not set. Please set it to upload prebuilds.'
12+
)
13+
process.exit(1)
14+
}
15+
16+
try {
17+
const prebuildPath = path.join(
818
__dirname,
919
'../node_modules/.bin/prebuild' +
1020
(process.platform === 'win32' ? '.cmd' : '')
11-
),
12-
['--upload-all', process.env.GITHUB_AUTH_TOKEN],
13-
{ stdio: 'inherit', shell: true }
14-
)
21+
)
22+
23+
// Check if prebuild command exists
24+
if (!fs.existsSync(prebuildPath)) {
25+
console.error('Prebuild command not found at:', prebuildPath)
26+
process.exit(1)
27+
}
28+
29+
console.log('Uploading prebuilds using:', prebuildPath)
30+
31+
const result = spawnSync(
32+
prebuildPath,
33+
['--upload-all', process.env.GITHUB_AUTH_TOKEN],
34+
{ stdio: 'inherit', shell: true }
35+
)
36+
37+
if (result.error) {
38+
console.error('Error uploading prebuilds:', result.error)
39+
process.exit(1)
40+
}
41+
if (result.status !== 0) {
42+
console.error('Prebuild upload failed with status:', result.status)
43+
process.exit(result.status)
44+
}
45+
console.log('Prebuilds uploaded successfully.')
46+
} catch (error) {
47+
console.error('An unexpected error occurred:', error)
48+
process.exit(1)
49+
}

0 commit comments

Comments
 (0)