Skip to content

Commit 2a470f5

Browse files
committed
patch: fix windows build and flash issues
- downgrade flasher's node to 20.11.1 on windows - bump windows GHA runner to 2022 - bump winusb-driver-generator to 2.1.9
1 parent f3123f3 commit 2a470f5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

‎.github/actions/publish/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
# Beware that native modules will be built for this version,
1616
# which might not be compatible with the one used by pkg (see forge.sidecar.ts)
1717
# https://github.com/vercel/pkg-fetch/releases
18-
default: '20.x'
18+
default: '20.19'
1919
VERBOSE:
2020
type: string
2121
default: 'true'

‎.github/actions/test/action.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ runs:
5959
# as the shrinkwrap might have been done on mac/linux, this is ensure the package is there for windows
6060
if [[ "$RUNNER_OS" == "Windows" ]]; then
6161
npm i -D winusb-driver-generator
62+
63+
# need to modifies @yao-pkg/pkg-fetch
64+
# expected-shas.json and patches.json files to force use of nodejs v20.11.1 instead of latest minor (v20.19.4 at the time of writing).
65+
# this is required for Windows compatibility as 20.15.1 introduced a regression that breaks the flasher on Windows.
66+
# As soon as nodejs the fix is backported to node20 and, or node 22, this script can be removed: https://github.com/nodejs/node/pull/55623
67+
68+
# Add entry to expected-shas.json
69+
sed -i 's/}$/,\n "node-v20.11.1-win-x64": "140c377c2c91751832e673cb488724cbd003f01aa237615142cd2907f34fa1a2"\n}/' node_modules/@yao-pkg/pkg-fetch/lib-es5/expected-shas.json
70+
71+
# Replace any "v20..." key with "v20.11.1" in patches.json (keeps value)
72+
sed -i -E 's/"v20[^"]*":/"v20.11.1":/' node_modules/@yao-pkg/pkg-fetch/patches/patches.json
6273
fi
6374
6475
npm run lint

‎.github/workflows/flowzone.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
{
2323
"os": [
2424
["ubuntu-22.04"],
25-
["windows-2019"],
25+
["windows-2022"],
2626
["macos-13"],
2727
["macos-latest-xlarge"]
2828
]
@@ -31,11 +31,11 @@ jobs:
3131
{
3232
"os": [
3333
["ubuntu-22.04"],
34-
["windows-2019"],
34+
["windows-2022"],
3535
["macos-13"],
3636
["macos-latest-xlarge"]
3737
]
3838
}
3939
restrict_custom_actions: false
4040
github_prerelease: true
41-
cloudflare_website: "etcher"
41+
cloudflare_website: 'etcher'

0 commit comments

Comments
 (0)