@@ -192,6 +192,55 @@ jobs:
192192 CIBW_BUILD : ${{ matrix.python }}-*
193193 CIBW_ARCHS : ARM64
194194
195+ - name : Verify Windows ARM64 wheels
196+ shell : pwsh
197+ run : |
198+ Add-Type -AssemblyName System.IO.Compression.FileSystem
199+ Get-ChildItem wheelhouse/*.whl | ForEach-Object {
200+ $archive = [System.IO.Compression.ZipFile]::OpenRead($_.FullName)
201+ try {
202+ $wheelEntry = $archive.Entries |
203+ Where-Object FullName -Like '*.dist-info/WHEEL' |
204+ Select-Object -First 1
205+ $nativeEntry = $archive.Entries |
206+ Where-Object FullName -Like 'uvloop/*.pyd' |
207+ Select-Object -First 1
208+ if (-not $wheelEntry -or -not $nativeEntry) {
209+ throw "Missing WHEEL metadata or native extension in $($_.Name)"
210+ }
211+
212+ $reader = [System.IO.StreamReader]::new($wheelEntry.Open())
213+ try {
214+ $wheelMetadata = $reader.ReadToEnd()
215+ } finally {
216+ $reader.Dispose()
217+ }
218+ if ($wheelMetadata -notmatch '(?m)^Tag: .+-win_arm64$') {
219+ throw "Missing win_arm64 tag in $($_.Name)"
220+ }
221+
222+ $memory = [System.IO.MemoryStream]::new()
223+ try {
224+ $stream = $nativeEntry.Open()
225+ try {
226+ $stream.CopyTo($memory)
227+ } finally {
228+ $stream.Dispose()
229+ }
230+ $bytes = $memory.ToArray()
231+ } finally {
232+ $memory.Dispose()
233+ }
234+ $peOffset = [BitConverter]::ToInt32($bytes, 0x3c)
235+ $machine = [BitConverter]::ToUInt16($bytes, $peOffset + 4)
236+ if ($machine -ne 0xAA64) {
237+ throw ('Expected ARM64 PE machine 0xAA64 in {0}, found 0x{1:X4}' -f $_.Name, $machine)
238+ }
239+ } finally {
240+ $archive.Dispose()
241+ }
242+ }
243+
195244 - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
196245 with :
197246 name : dist-wheels-windows-arm64-${{ matrix.python }}
0 commit comments