Skip to content

Commit 832eb27

Browse files
authored
Enable Windows ARM64 builds in CI (#340)
1 parent 70ec822 commit 832eb27

File tree

3 files changed

+69
-6
lines changed

3 files changed

+69
-6
lines changed

.github/workflows/build-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
- platform: "windows-latest"
2626
args: ""
2727
target: "x86_64-pc-windows-msvc"
28+
- platform: "windows-11-arm" # for ARM64 Windows runner
29+
args: "--target aarch64-pc-windows-msvc"
30+
target: "aarch64-pc-windows-msvc"
2831

2932
uses: ./.github/workflows/build.yml
3033
with:

.github/workflows/build.yml

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,17 @@ jobs:
7777
echo "Build profile: release"
7878
fi
7979
80-
- uses: oven-sh/setup-bun@v2
80+
- name: Setup Bun (standard)
81+
if: ${{ !(contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')) }}
82+
uses: oven-sh/setup-bun@v2
83+
84+
# Bun does not fully support Windows ARM64 yet, so we pin the baseline build.
85+
# See https://github.com/oven-sh/bun/issues/9824 for details.
86+
- name: Setup Bun (Windows ARM64 baseline)
87+
if: ${{ contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64') }}
88+
uses: oven-sh/setup-bun@v2
89+
with:
90+
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip"
8191

8292
- name: install Rust stable
8393
uses: dtolnay/rust-toolchain@stable
@@ -109,13 +119,54 @@ jobs:
109119
sudo apt-get update
110120
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev libopenblas-dev libx11-dev libxtst-dev libxrandr-dev
111121
112-
- name: Install Vulkan SDK (Windows)
113-
if: contains(inputs.platform, 'windows')
122+
- name: Install Vulkan SDK (Windows x64)
123+
if: contains(inputs.platform, 'windows') && !contains(inputs.target, 'aarch64')
114124
uses: humbletim/[email protected]
115125
with:
116126
version: 1.4.309.0
117127
cache: true
118128

129+
# humbletim/[email protected] cannot target Windows ARM64 yet.
130+
# Download prebuilt binaries (Bin) + build headers/libs from source.
131+
# See https://github.com/humbletim/install-vulkan-sdk/pull/22 for prebuilt ARM64 support progress.
132+
- name: Prepare Vulkan SDK env (Windows ARM64)
133+
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
134+
shell: pwsh
135+
run: |
136+
$sdkDir = Join-Path $env:GITHUB_WORKSPACE "VULKAN_SDK"
137+
New-Item -ItemType Directory -Force -Path $sdkDir | Out-Null
138+
Add-Content -Path $env:GITHUB_ENV -Value "VULKAN_SDK=$sdkDir"
139+
140+
- name: Download Vulkan SDK binaries (Windows ARM64)
141+
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
142+
shell: pwsh
143+
run: |
144+
$url = "https://sdk.lunarg.com/sdk/download/1.4.309.0/warm/InstallVulkanARM64-1.4.309.0.exe"
145+
$outFile = "vulkan_sdk_arm.exe"
146+
Write-Host "Downloading Vulkan SDK binaries from $url"
147+
Invoke-WebRequest -Uri $url -OutFile $outFile
148+
149+
- name: Extract Vulkan SDK binaries (Windows ARM64)
150+
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
151+
shell: pwsh
152+
run: |
153+
$sdkDir = $env:VULKAN_SDK
154+
$sevenZip = (Get-Command 7z.exe -ErrorAction Stop).Source
155+
Write-Host "Extracting binaries to $sdkDir"
156+
& $sevenZip x "./vulkan_sdk_arm.exe" "-o$sdkDir" -aoa
157+
$binPath = Join-Path $sdkDir "Bin"
158+
Add-Content -Path $env:GITHUB_PATH -Value $binPath
159+
Write-Host "Verifying glslc..."
160+
& (Join-Path $binPath "glslc.exe") --version
161+
162+
- name: Build Vulkan SDK headers and libs (Windows ARM64)
163+
if: contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')
164+
uses: humbletim/[email protected]
165+
with:
166+
vulkan-query-version: 1.4.309.0
167+
vulkan-components: Vulkan-Headers, Vulkan-Loader
168+
vulkan-use-cache: true
169+
119170
- name: Install trusted-signing-cli
120171
if: contains(inputs.platform, 'windows') && inputs.sign-binaries
121172
run: cargo install trusted-signing-cli
@@ -139,10 +190,15 @@ jobs:
139190
sudo apt-get install -y mesa-vulkan-drivers
140191
141192
- name: install frontend dependencies
193+
if: ${{ !(contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64')) }}
142194
run: bun install
143195

196+
- name: install frontend dependencies (Windows ARM64)
197+
if: ${{ contains(inputs.platform, 'windows') && contains(inputs.target, 'aarch64') }}
198+
run: bun install --cpu=arm64
199+
144200
- name: rustup install target
145-
if: ${{ inputs.target != '' && !contains(inputs.target, 'unknown-linux-gnu') && !contains(inputs.target, 'pc-windows-msvc') }}
201+
if: ${{ inputs.target != '' && !contains(inputs.target, 'unknown-linux-gnu') && !contains(inputs.target, 'x86_64-pc-windows-msvc') }}
146202
run: rustup target add ${{ inputs.target }}
147203

148204
- name: import Apple Developer Certificate
@@ -284,7 +340,8 @@ jobs:
284340
uses: actions/upload-artifact@v4
285341
with:
286342
name: ${{ inputs.asset-prefix }}-${{ inputs.target }}
343+
# Default Windows builds place bundles under release/, but cross-compiles (ARM64) nest under target/<triple>/release.
287344
path: |
288-
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/msi/*.msi
289-
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/nsis/*.exe
345+
src-tauri/target/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/msi/*.msi
346+
src-tauri/target/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/nsis/*.exe
290347
retention-days: 30

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- platform: "windows-latest"
6262
args: ""
6363
target: "x86_64-pc-windows-msvc"
64+
- platform: "windows-11-arm" # for ARM64 Windows runner
65+
args: "--target aarch64-pc-windows-msvc"
66+
target: "aarch64-pc-windows-msvc"
6467

6568
uses: ./.github/workflows/build.yml
6669
with:

0 commit comments

Comments
 (0)