9595 token : ${{ secrets.GITHUB_TOKEN }}
9696 continue-on-error : true
9797
98- - name : Build Virtual Driver Control App
98+ - name : Build Virtual Driver Control App (ARM64)
9999 run : |
100100 $controlAppPath = ""
101101
@@ -111,31 +111,36 @@ jobs:
111111 }
112112
113113 if ($controlAppPath -ne "") {
114- Write-Output "Building Virtual Driver Control App..."
114+ Write-Output "Building Virtual Driver Control App for ARM64 ..."
115115 Push-Location $controlAppPath
116116
117117 # Install dependencies
118118 Write-Output "Installing npm dependencies..."
119119 npm ci
120120
121- # Build portable app
122- Write-Output "Building portable executable..."
121+ # Modify package.json to build for ARM64
122+ $packageJson = Get-Content "package.json" | ConvertFrom-Json
123+ $packageJson.build.win.target[0].arch = @("arm64")
124+ $packageJson | ConvertTo-Json -Depth 10 | Set-Content "package.json"
125+
126+ # Build portable app for ARM64
127+ Write-Output "Building portable executable for ARM64..."
123128 npm run build-portable
124129
125130 Pop-Location
126131
127132 # Copy built app to publish directory
128- $publishDir = "./control-app-publish"
133+ $publishDir = "./control-app-publish-arm64 "
129134 New-Item -ItemType Directory -Path $publishDir -Force
130135
131136 # The portable build should be in dist folder
132137 $distPath = "$controlAppPath/dist"
133138 if (Test-Path $distPath) {
134139 Copy-Item "$distPath/*" -Destination $publishDir -Recurse -Force
135- Write-Output "✅ Virtual Driver Control App build completed"
140+ Write-Output "✅ Virtual Driver Control App ARM64 build completed"
136141
137142 # List contents for verification
138- Write-Output "Built files:"
143+ Write-Output "Built ARM64 files:"
139144 Get-ChildItem $publishDir -Recurse | ForEach-Object { Write-Output " - $($_.Name)" }
140145 } else {
141146 Write-Output "❌ Build output directory not found: $distPath"
@@ -167,9 +172,9 @@ jobs:
167172 }
168173
169174 # Copy Control App files
170- if (Test-Path "control-app-publish") {
171- Copy-Item "control-app-publish\*" -Destination $controlDir -Recurse -Force
172- Write-Output "✅ Copied Control App files"
175+ if (Test-Path "control-app-publish-arm64 ") {
176+ Copy-Item "control-app-publish-arm64 \*" -Destination $controlDir -Recurse -Force
177+ Write-Output "✅ Copied Control App ARM64 files"
173178 }
174179
175180 Write-Output "ARM64_PACKAGE_DIR=$packageDir" >> $env:GITHUB_ENV
@@ -270,13 +275,67 @@ jobs:
270275 exit 1
271276 }
272277
273- # Download ARM64 artifacts to get Control App
274- - name : Download ARM64 components for Control App
275- uses : actions/download-artifact@v4
278+ # Checkout Virtual Driver Control Repository for x64 build
279+ - name : Checkout Virtual Driver Control Repository
280+ if : github.repository != 'VirtualDrivers/Virtual-Driver-Control'
281+ uses : actions/checkout@v4
276282 with :
277- name : ARM64-Components-${{ env.BUILD_CONFIGURATION }}
278- path : arm64-components-temp
279-
283+ repository : ' VirtualDrivers/Virtual-Driver-Control'
284+ path : ' control-app-repo-x64'
285+ token : ${{ secrets.GITHUB_TOKEN }}
286+ continue-on-error : true
287+
288+ - name : Build Virtual Driver Control App (x64)
289+ run : |
290+ $controlAppPath = ""
291+
292+ # Check if control app is in current repo (unlikely but check anyway)
293+ if (Test-Path "VirtualDriverControl/package.json") {
294+ $controlAppPath = "VirtualDriverControl"
295+ Write-Output "Found control app in current repository"
296+ }
297+ # Check if control app was checked out separately
298+ elseif (Test-Path "control-app-repo-x64/VirtualDriverControl/package.json") {
299+ $controlAppPath = "control-app-repo-x64/VirtualDriverControl"
300+ Write-Output "Found control app in separate repository"
301+ }
302+
303+ if ($controlAppPath -ne "") {
304+ Write-Output "Building Virtual Driver Control App for x64..."
305+ Push-Location $controlAppPath
306+
307+ # Install dependencies
308+ Write-Output "Installing npm dependencies..."
309+ npm ci
310+
311+ # Build portable app for x64 (default configuration)
312+ Write-Output "Building portable executable for x64..."
313+ npm run build-portable
314+
315+ Pop-Location
316+
317+ # Copy built app to publish directory
318+ $publishDir = "./control-app-publish-x64"
319+ New-Item -ItemType Directory -Path $publishDir -Force
320+
321+ # The portable build should be in dist folder
322+ $distPath = "$controlAppPath/dist"
323+ if (Test-Path $distPath) {
324+ Copy-Item "$distPath/*" -Destination $publishDir -Recurse -Force
325+ Write-Output "✅ Virtual Driver Control App x64 build completed"
326+
327+ # List contents for verification
328+ Write-Output "Built x64 files:"
329+ Get-ChildItem $publishDir -Recurse | ForEach-Object { Write-Output " - $($_.Name)" }
330+ } else {
331+ Write-Output "❌ Build output directory not found: $distPath"
332+ exit 1
333+ }
334+ } else {
335+ Write-Output "❌ Virtual Driver Control App package.json not found"
336+ exit 1
337+ }
338+
280339 # Package x64 components (VDD + VAD + Control App)
281340 - name : Package x64 components
282341 run : |
@@ -306,10 +365,10 @@ jobs:
306365 }
307366 Write-Output "✅ Copied VAD x64 files"
308367
309- # Copy Control App files from ARM64 artifacts (platform-independent )
310- if (Test-Path "arm64-components-temp\ControlApp ") {
311- Copy-Item "arm64-components-temp\ControlApp \*" -Destination $controlDir -Recurse -Force
312- Write-Output "✅ Copied Control App files to x64 package"
368+ # Copy Control App files (x64 build )
369+ if (Test-Path "control-app-publish-x64 ") {
370+ Copy-Item "control-app-publish-x64 \*" -Destination $controlDir -Recurse -Force
371+ Write-Output "✅ Copied Control App x64 files to x64 package"
313372 }
314373
315374 Write-Output "X64_PACKAGE_DIR=$packageDir" >> $env:GITHUB_ENV
@@ -512,9 +571,10 @@ jobs:
512571 Write-Output "Built installer: $($_.Name) ($(($_.Length / 1MB).ToString('F2')) MB)"
513572 }
514573
515- # Set environment variable for later upload
516- $installerFile = (Get-ChildItem "output\*.exe" | Select-Object -First 1).FullName
517- Write-Output "INSTALLER_PATH=$installerFile" >> $env:GITHUB_ENV
574+ # Set environment variable for later upload (relative to workflow root)
575+ $installerFile = (Get-ChildItem "output\*.exe" | Select-Object -First 1).Name
576+ $installerPath = "installer-repo\output\$installerFile"
577+ Write-Output "INSTALLER_PATH=$installerPath" >> $env:GITHUB_ENV
518578 } else {
519579 Write-Output "❌ No installer executable found in output directory"
520580 exit 1
0 commit comments