Skip to content

Commit efecbf3

Browse files
committed
test: add win-arm64 native build workflow
Test building on windows-11-arm runner to fix broken ARM64 bytecodes. Cross-compiling from Linux ARM64 produces incompatible V8 code cache.
1 parent eca920e commit efecbf3

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test Win ARM64 Build
2+
3+
on:
4+
push:
5+
branches:
6+
- fix/win-arm64-build
7+
8+
jobs:
9+
build:
10+
name: Build win-arm64
11+
runs-on: windows-11-arm
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build TypeScript
26+
run: npm run mainnet:build:src
27+
28+
- name: Build binary
29+
run: npx pkg out/src/main-mainnet.js -t node16-win-arm64 --output bin/edge
30+
31+
- name: Show binary info
32+
shell: pwsh
33+
run: |
34+
$f = Get-Item bin\edge.exe
35+
Write-Host "Size: $($f.Length) bytes ($([math]::Round($f.Length/1MB, 1)) MB)"
36+
$bytes = [System.IO.File]::ReadAllBytes($f.FullName)
37+
$peOffset = [BitConverter]::ToInt32($bytes, 60)
38+
$machine = [BitConverter]::ToUInt16($bytes, $peOffset + 4)
39+
Write-Host "PE Machine: 0x$($machine.ToString('X4'))"
40+
switch ($machine) {
41+
0x8664 { Write-Host 'Architecture: x64 (AMD64)' }
42+
0xAA64 { Write-Host 'Architecture: ARM64' }
43+
}
44+
45+
- name: Test binary
46+
shell: pwsh
47+
run: |
48+
Write-Host "--- Testing --version ---"
49+
& bin\edge.exe --version
50+
Write-Host "--- Testing --help ---"
51+
& bin\edge.exe --help
52+
53+
- name: Rename and upload
54+
shell: pwsh
55+
run: |
56+
Rename-Item -Path bin\edge.exe -NewName edge-win-arm64.exe
57+
Get-ChildItem bin\
58+
59+
- name: Upload artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: edge-win-arm64
63+
path: bin/edge-win-arm64.exe

0 commit comments

Comments
 (0)