Files
SpotiFLAC-Mobile/scripts/setup_flutter_windows_arm64.ps1
T
zarzet 8f553c7aa3 feat(windows): prepare native ARM64 builds and packages
Add architecture-specific CI jobs, native playback dependencies and bundle validation. Native Windows ARM64 compilation and runtime testing are still pending.
2026-10-22 23:10:34 +07:00

28 lines
1.2 KiB
PowerShell

[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
if ($env:PROCESSOR_ARCHITECTURE -ne 'ARM64') {
throw 'Run this setup on a native Windows ARM64 runner.'
}
$projectDir = Split-Path -Parent $PSScriptRoot
$version = (Get-Content (Join-Path $projectDir '.fvmrc') | ConvertFrom-Json).flutter
$flutterDir = Join-Path $env:RUNNER_TEMP "flutter-$version-arm64"
git clone --depth 1 --branch $version https://github.com/flutter/flutter.git $flutterDir
if ($LASTEXITCODE -ne 0) { throw 'Cloning the pinned Flutter SDK failed.' }
$flutter = Join-Path $flutterDir 'bin\flutter.bat'
& $flutter config --enable-windows-desktop --no-analytics
if ($LASTEXITCODE -ne 0) { throw 'Initializing Flutter failed.' }
$dart = Join-Path $flutterDir 'bin\cache\dart-sdk\bin\dart.exe'
$dartVersion = & $dart --version 2>&1 | Out-String
if ($LASTEXITCODE -ne 0 -or $dartVersion -notmatch 'windows_arm64') {
throw "The pinned SDK did not provide native ARM64 Dart: $dartVersion"
}
& $flutter precache --windows
if ($LASTEXITCODE -ne 0) { throw 'Fetching the Windows engine failed.' }
Add-Content $env:GITHUB_PATH (Join-Path $flutterDir 'bin')
Add-Content $env:GITHUB_ENV "FLUTTER_ROOT=$flutterDir"