1616 - runner : windows-latest
1717 goos : windows
1818 goarch : amd64
19- - runner : windows-11-arm
19+ - runner : windows-latest
2020 goos : windows
2121 goarch : arm64
2222 - runner : ubuntu-latest
8484 sudo apt-get install -y build-essential pkg-config xorg-dev libgl1-mesa-dev dpkg-dev lintian
8585 fi
8686
87+ - name : Install LLVM-MinGW toolchain for Windows ARM64 cross build
88+ if : matrix.goos == 'windows' && matrix.goarch == 'arm64'
89+ shell : pwsh
90+ run : |
91+ $ErrorActionPreference = 'Stop'
92+ $version = '20250114'
93+ $zipName = "llvm-mingw-$version-ucrt-x86_64.zip"
94+ $url = "https://github.com/mstorsjo/llvm-mingw/releases/download/$version/$zipName"
95+ Invoke-WebRequest -Uri $url -OutFile $zipName
96+ Expand-Archive -Path $zipName -DestinationPath . -Force
97+ $toolchain = Join-Path $PWD "llvm-mingw-$version-ucrt-x86_64"
98+ if (-not (Test-Path $toolchain)) {
99+ throw "LLVM-MinGW toolchain directory not found: $toolchain"
100+ }
101+ "$(Join-Path $toolchain 'bin')" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
102+
87103 - name : Build binary
88104 shell : pwsh
89105 env :
@@ -100,16 +116,13 @@ jobs:
100116 $env:PKG_CONFIG_LIBDIR = "/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig"
101117 }
102118 if ($env:GOOS -eq "windows" -and $env:GOARCH -eq "arm64") {
103- $clang = Get-Command clang -ErrorAction SilentlyContinue
104- $clangxx = Get-Command clang++ -ErrorAction SilentlyContinue
105- if (-not $clang -or -not $clangxx ) {
106- throw "clang/clang++ are required for Windows ARM64 build"
119+ $cc = Get-Command aarch64-w64-mingw32- clang -ErrorAction SilentlyContinue
120+ $cxx = Get-Command aarch64-w64-mingw32- clang++ -ErrorAction SilentlyContinue
121+ if (-not $cc -or -not $cxx ) {
122+ throw "aarch64-w64-mingw32- clang/clang++ are required for Windows ARM64 build"
107123 }
108- $env:CC = "clang"
109- $env:CXX = "clang++"
110- $env:CGO_CFLAGS = "--target=aarch64-windows-msvc"
111- $env:CGO_CXXFLAGS = "--target=aarch64-windows-msvc"
112- $env:CGO_LDFLAGS = "--target=aarch64-windows-msvc"
124+ $env:CC = "aarch64-w64-mingw32-clang"
125+ $env:CXX = "aarch64-w64-mingw32-clang++"
113126 }
114127 if ($env:GOOS -eq "windows") {
115128 $out = "dist/eris_${env:VERSION}_windows_${env:ASSET_ARCH}.exe"
@@ -120,7 +133,7 @@ jobs:
120133 }
121134
122135 - name : Smoke test Windows binary
123- if : matrix.goos == 'windows'
136+ if : matrix.goos == 'windows' && matrix.goarch == 'amd64'
124137 shell : pwsh
125138 env :
126139 VERSION : ${{ steps.version.outputs.version }}
@@ -136,6 +149,23 @@ jobs:
136149 }
137150 Stop-Process -Id $p.Id -Force
138151
152+ - name : Validate Windows ARM64 artifact exists
153+ if : matrix.goos == 'windows' && matrix.goarch == 'arm64'
154+ shell : pwsh
155+ env :
156+ VERSION : ${{ steps.version.outputs.version }}
157+ ASSET_ARCH : ${{ steps.meta.outputs.asset_arch }}
158+ run : |
159+ $ErrorActionPreference = 'Stop'
160+ $exe = "dist/eris_${env:VERSION}_windows_${env:ASSET_ARCH}.exe"
161+ if (-not (Test-Path $exe)) {
162+ throw "Expected artifact not found: $exe"
163+ }
164+ $size = (Get-Item $exe).Length
165+ if ($size -le 0) {
166+ throw "Artifact is empty: $exe"
167+ }
168+
139169 - name : Package Linux binary archive
140170 if : matrix.goos == 'linux'
141171 shell : bash
0 commit comments