Skip to content

Commit dd198e5

Browse files
Update build-and-sign-sequential.yml
1 parent 4b6ba22 commit dd198e5

1 file changed

Lines changed: 181 additions & 44 deletions

File tree

.github/workflows/build-and-sign-sequential.yml

Lines changed: 181 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ jobs:
4444
with:
4545
dotnet-version: '6.0.x'
4646

47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: '18'
51+
cache: 'npm'
52+
cache-dependency-path: '**/package-lock.json'
53+
4754
# Build Virtual Display Driver for ARM64
4855
- name: Build Virtual Display Driver (ARM64)
4956
run: |
@@ -80,45 +87,68 @@ jobs:
8087
Write-Output "ℹ️ Skipping ARM64 VAD build due to Windows Driver Kit ARM64 cross-compilation issues"
8188
Write-Output "ℹ️ VAD will be built for x64 only in the next job"
8289
83-
# Build Control Panel (platform-independent, only build once)
84-
- name: Checkout Control Panel Repository
90+
# Build Electron Control App (platform-independent, only build once)
91+
- name: Checkout Virtual Driver Control Repository
8592
if: github.repository != 'VirtualDrivers/Virtual-Driver-Control'
8693
uses: actions/checkout@v4
8794
with:
8895
repository: 'VirtualDrivers/Virtual-Driver-Control'
89-
path: 'control-panel-repo'
96+
path: 'control-app-repo'
9097
token: ${{ secrets.GITHUB_TOKEN }}
9198
continue-on-error: true
9299

93-
- name: Build Control Panel
100+
- name: Build Virtual Driver Control App
94101
run: |
95-
$controlPanelPath = ""
102+
$controlAppPath = ""
96103
97-
# Check if control panel is in current repo
98-
if (Test-Path "VDD Control/VDD Control.sln") {
99-
$controlPanelPath = "VDD Control/VDD Control.sln"
100-
$projectPath = "VDD Control/VDD Control/VDD Control.csproj"
101-
Write-Output "Found control panel in current repository"
104+
# Check if control app is in current repo (unlikely but check anyway)
105+
if (Test-Path "VirtualDriverControl/package.json") {
106+
$controlAppPath = "VirtualDriverControl"
107+
Write-Output "Found control app in current repository"
102108
}
103-
# Check if control panel was checked out separately
104-
elseif (Test-Path "control-panel-repo/VDD Control/VDD Control.sln") {
105-
$controlPanelPath = "control-panel-repo/VDD Control/VDD Control.sln"
106-
$projectPath = "control-panel-repo/VDD Control/VDD Control/VDD Control.csproj"
107-
Write-Output "Found control panel in separate repository"
109+
# Check if control app was checked out separately
110+
elseif (Test-Path "control-app-repo/VirtualDriverControl/package.json") {
111+
$controlAppPath = "control-app-repo/VirtualDriverControl"
112+
Write-Output "Found control app in separate repository"
108113
}
109114
110-
if ($controlPanelPath -ne "") {
111-
Write-Output "Building Control Panel..."
112-
dotnet restore $controlPanelPath
113-
dotnet build $controlPanelPath --configuration $env:BUILD_CONFIGURATION --no-restore
114-
dotnet publish $projectPath --configuration $env:BUILD_CONFIGURATION --output ./control-panel-publish --no-build
115-
Write-Output "✅ Control Panel build completed"
115+
if ($controlAppPath -ne "") {
116+
Write-Output "Building Virtual Driver Control App..."
117+
Push-Location $controlAppPath
118+
119+
# Install dependencies
120+
Write-Output "Installing npm dependencies..."
121+
npm ci
122+
123+
# Build portable app
124+
Write-Output "Building portable executable..."
125+
npm run build-portable
126+
127+
Pop-Location
128+
129+
# Copy built app to publish directory
130+
$publishDir = "./control-app-publish"
131+
New-Item -ItemType Directory -Path $publishDir -Force
132+
133+
# The portable build should be in dist folder
134+
$distPath = "$controlAppPath/dist"
135+
if (Test-Path $distPath) {
136+
Copy-Item "$distPath/*" -Destination $publishDir -Recurse -Force
137+
Write-Output "✅ Virtual Driver Control App build completed"
138+
139+
# List contents for verification
140+
Write-Output "Built files:"
141+
Get-ChildItem $publishDir -Recurse | ForEach-Object { Write-Output " - $($_.Name)" }
142+
} else {
143+
Write-Output "❌ Build output directory not found: $distPath"
144+
exit 1
145+
}
116146
} else {
117-
Write-Output "❌ Control Panel solution file not found"
147+
Write-Output "❌ Virtual Driver Control App package.json not found"
118148
exit 1
119149
}
120150
121-
# Package ARM64 components (VDD + Control Panel only)
151+
# Package ARM64 components (VDD + Control App only)
122152
- name: Package ARM64 components
123153
run: |
124154
Write-Output "Creating ARM64 package..."
@@ -127,7 +157,7 @@ jobs:
127157
128158
# Create component directories
129159
$vddDir = "$packageDir\VDD"
130-
$controlDir = "$packageDir\ControlPanel"
160+
$controlDir = "$packageDir\ControlApp"
131161
New-Item -ItemType Directory -Path $vddDir -Force
132162
New-Item -ItemType Directory -Path $controlDir -Force
133163
@@ -138,10 +168,10 @@ jobs:
138168
Write-Output "✅ Copied VDD ARM64 files"
139169
}
140170
141-
# Copy Control Panel files
142-
if (Test-Path "control-panel-publish") {
143-
Copy-Item "control-panel-publish\*" -Destination $controlDir -Recurse -Force
144-
Write-Output "✅ Copied Control Panel files"
171+
# Copy Control App files
172+
if (Test-Path "control-app-publish") {
173+
Copy-Item "control-app-publish\*" -Destination $controlDir -Recurse -Force
174+
Write-Output "✅ Copied Control App files"
145175
}
146176
147177
Write-Output "ARM64_PACKAGE_DIR=$packageDir" >> $env:GITHUB_ENV
@@ -181,6 +211,13 @@ jobs:
181211
choco install windowsdriverkit11 -y
182212
if ($LASTEXITCODE -ne 0) { exit 1 }
183213
214+
- name: Setup Node.js
215+
uses: actions/setup-node@v4
216+
with:
217+
node-version: '18'
218+
cache: 'npm'
219+
cache-dependency-path: '**/package-lock.json'
220+
184221
# Build Virtual Display Driver for x64
185222
- name: Build Virtual Display Driver (x64)
186223
run: |
@@ -237,7 +274,14 @@ jobs:
237274
exit 1
238275
}
239276
240-
# Package x64 components (VDD + VAD)
277+
# Download ARM64 artifacts to get Control App
278+
- name: Download ARM64 components for Control App
279+
uses: actions/download-artifact@v4
280+
with:
281+
name: ARM64-Components-${{ env.BUILD_CONFIGURATION }}
282+
path: arm64-components-temp
283+
284+
# Package x64 components (VDD + VAD + Control App)
241285
- name: Package x64 components
242286
run: |
243287
Write-Output "Creating x64 package..."
@@ -247,8 +291,10 @@ jobs:
247291
# Create component directories
248292
$vddDir = "$packageDir\VDD"
249293
$vadDir = "$packageDir\VAD"
294+
$controlDir = "$packageDir\ControlApp"
250295
New-Item -ItemType Directory -Path $vddDir -Force
251296
New-Item -ItemType Directory -Path $vadDir -Force
297+
New-Item -ItemType Directory -Path $controlDir -Force
252298
253299
# Copy VDD x64 files
254300
$vddBuildDir = "Virtual Display Driver (HDR)\x64\$env:BUILD_CONFIGURATION\MttVDD"
@@ -264,6 +310,12 @@ jobs:
264310
}
265311
Write-Output "✅ Copied VAD x64 files"
266312
313+
# Copy Control App files from ARM64 artifacts (platform-independent)
314+
if (Test-Path "arm64-components-temp\ControlApp") {
315+
Copy-Item "arm64-components-temp\ControlApp\*" -Destination $controlDir -Recurse -Force
316+
Write-Output "✅ Copied Control App files to x64 package"
317+
}
318+
267319
Write-Output "X64_PACKAGE_DIR=$packageDir" >> $env:GITHUB_ENV
268320
269321
# Upload x64 artifacts
@@ -311,23 +363,23 @@ jobs:
311363
New-Item -ItemType Directory -Path $x64Dir -Force
312364
313365
# Create component subdirectories
314-
# ARM64: VDD + Control Panel only
366+
# ARM64: VDD + Control App only
315367
New-Item -ItemType Directory -Path "$arm64Dir\VDD" -Force
316-
New-Item -ItemType Directory -Path "$arm64Dir\ControlPanel" -Force
368+
New-Item -ItemType Directory -Path "$arm64Dir\ControlApp" -Force
317369
318-
# x64: VDD + VAD + Control Panel
370+
# x64: VDD + VAD + Control App
319371
New-Item -ItemType Directory -Path "$x64Dir\VDD" -Force
320372
New-Item -ItemType Directory -Path "$x64Dir\VAD" -Force
321-
New-Item -ItemType Directory -Path "$x64Dir\ControlPanel" -Force
373+
New-Item -ItemType Directory -Path "$x64Dir\ControlApp" -Force
322374
323-
# Copy ARM64 components (VDD + Control Panel)
375+
# Copy ARM64 components (VDD + Control App)
324376
if (Test-Path "arm64-components\VDD") {
325377
Copy-Item "arm64-components\VDD\*" -Destination "$arm64Dir\VDD" -Force
326378
Write-Output "✅ Copied ARM64 VDD files"
327379
}
328-
if (Test-Path "arm64-components\ControlPanel") {
329-
Copy-Item "arm64-components\ControlPanel\*" -Destination "$arm64Dir\ControlPanel" -Recurse -Force
330-
Write-Output "✅ Copied Control Panel files to ARM64 package"
380+
if (Test-Path "arm64-components\ControlApp") {
381+
Copy-Item "arm64-components\ControlApp\*" -Destination "$arm64Dir\ControlApp" -Recurse -Force
382+
Write-Output "✅ Copied Control App files to ARM64 package"
331383
}
332384
333385
# Copy x64 components (VDD + VAD)
@@ -340,10 +392,10 @@ jobs:
340392
Write-Output "✅ Copied x64 VAD files"
341393
}
342394
343-
# Copy Control Panel to x64 as well (shared component)
344-
if (Test-Path "arm64-components\ControlPanel") {
345-
Copy-Item "arm64-components\ControlPanel\*" -Destination "$x64Dir\ControlPanel" -Recurse -Force
346-
Write-Output "✅ Copied Control Panel files to x64 package"
395+
# Copy Control App to x64 as well (shared component)
396+
if (Test-Path "x64-components\ControlApp") {
397+
Copy-Item "x64-components\ControlApp\*" -Destination "$x64Dir\ControlApp" -Recurse -Force
398+
Write-Output "✅ Copied Control App files to x64 package"
347399
}
348400
349401
# Display final package structure
@@ -416,6 +468,81 @@ jobs:
416468
name: Signed-Unified-Package-Mixed-Platform-${{ env.BUILD_CONFIGURATION }}
417469
path: '${{ vars.SIGNPATH_OUTPUT_DIR }}\*'
418470
continue-on-error: true
471+
472+
# Checkout Virtual Driver Installer Repository
473+
- name: Checkout Virtual Driver Installer Repository
474+
uses: actions/checkout@v4
475+
with:
476+
repository: 'VirtualDrivers/Virtual-Driver-Installer'
477+
path: 'installer-repo'
478+
token: ${{ secrets.GITHUB_TOKEN }}
479+
continue-on-error: true
480+
481+
# Build installer using signed components
482+
- name: Build Virtual Driver Installer
483+
if: steps.signpath_unified_request.outcome == 'success'
484+
run: |
485+
Write-Output "Building Virtual Driver Installer..."
486+
487+
$installerPath = "installer-repo"
488+
if (-not (Test-Path $installerPath)) {
489+
Write-Output "❌ Installer repository not found"
490+
exit 1
491+
}
492+
493+
Push-Location $installerPath
494+
495+
# Copy signed artifacts to installer input directory
496+
$signedArtifactsPath = "${{ vars.SIGNPATH_OUTPUT_DIR }}"
497+
if (Test-Path $signedArtifactsPath) {
498+
Write-Output "Copying signed artifacts to installer input..."
499+
500+
# Create SignedArtifacts directory structure expected by build script
501+
New-Item -ItemType Directory -Path "SignedArtifacts" -Force
502+
Copy-Item "$signedArtifactsPath\*" -Destination "SignedArtifacts\" -Recurse -Force
503+
504+
Write-Output "Contents of SignedArtifacts directory:"
505+
Get-ChildItem "SignedArtifacts" -Recurse | ForEach-Object { Write-Output " - $($_.FullName)" }
506+
507+
# Run the installer build script
508+
Write-Output "Running installer build script..."
509+
if (Test-Path "build-installer.ps1") {
510+
.\build-installer.ps1
511+
512+
# Check if installer was built successfully
513+
if (Test-Path "output\*.exe") {
514+
Write-Output "✅ Installer built successfully"
515+
Get-ChildItem "output\*.exe" | ForEach-Object {
516+
Write-Output "Built installer: $($_.Name) ($(($_.Length / 1MB).ToString('F2')) MB)"
517+
}
518+
519+
# Set environment variable for later upload
520+
$installerFile = (Get-ChildItem "output\*.exe" | Select-Object -First 1).FullName
521+
Write-Output "INSTALLER_PATH=$installerFile" >> $env:GITHUB_ENV
522+
} else {
523+
Write-Output "❌ No installer executable found in output directory"
524+
exit 1
525+
}
526+
} else {
527+
Write-Output "❌ build-installer.ps1 not found"
528+
exit 1
529+
}
530+
} else {
531+
Write-Output "❌ Signed artifacts not found at: $signedArtifactsPath"
532+
exit 1
533+
}
534+
535+
Pop-Location
536+
continue-on-error: true
537+
538+
# Upload built installer
539+
- name: Upload Virtual Driver Installer
540+
if: env.INSTALLER_PATH != ''
541+
uses: actions/upload-artifact@v4
542+
with:
543+
name: Virtual-Driver-Installer-${{ env.BUILD_CONFIGURATION }}-${{ env.RELEASE_TAG }}
544+
path: ${{ env.INSTALLER_PATH }}
545+
continue-on-error: true
419546

420547
# Build Summary
421548
- name: Build and SignPath Summary
@@ -430,14 +557,15 @@ jobs:
430557
Write-Output "Build Strategy: Sequential with Mixed Platform Support"
431558
Write-Output ""
432559
Write-Output "Platform-Specific Components Built:"
433-
Write-Output "ARM64: VDD + Control Panel (VAD skipped due to WDK limitations)"
434-
Write-Output "x64: VDD + VAD + Control Panel"
560+
Write-Output "ARM64: VDD + Control App (VAD skipped due to WDK limitations)"
561+
Write-Output "x64: VDD + VAD + Control App"
435562
Write-Output ""
436563
Write-Output "This workflow successfully:"
437-
Write-Output "✅ Built ARM64 VDD and Control Panel first"
564+
Write-Output "✅ Built ARM64 VDD and Electron Control App first"
438565
Write-Output "✅ Built x64 drivers after ARM64 completion (VDD + VAD)"
439566
Write-Output "✅ Created unified package containing all working components"
440567
Write-Output "✅ Submitted single unified package to SignPath for code signing"
568+
Write-Output "✅ Built installer using signed components"
441569
Write-Output "✅ Generated automatic release tags for version tracking"
442570
Write-Output ""
443571
Write-Output "Benefits of This Approach:"
@@ -446,6 +574,8 @@ jobs:
446574
Write-Output "• Single SignPath submission for all platforms"
447575
Write-Output "• Works around WDK ARM64 cross-compilation limitations"
448576
Write-Output "• VAD still available for primary x64 platform"
577+
Write-Output "• Electron-based Control App for modern UI experience"
578+
Write-Output "• Automated installer generation from signed components"
449579
Write-Output ""
450580
Write-Output "SignPath Integration Status:"
451581
if ('${{ steps.signpath_unified_request.outcome }}' -eq 'success') {
@@ -454,5 +584,12 @@ jobs:
454584
Write-Output "❌ Unified package signing failed or skipped"
455585
}
456586
Write-Output ""
587+
Write-Output "Installer Build Status:"
588+
if ('${{ env.INSTALLER_PATH }}' -ne '') {
589+
Write-Output "✅ Virtual Driver Installer built successfully"
590+
} else {
591+
Write-Output "❌ Installer build failed or skipped"
592+
}
593+
Write-Output ""
457594
Write-Output "⚠️ Note: ARM64 VAD skipped due to Windows Driver Kit cross-compilation issues"
458595
Write-Output " This is a known limitation with WDK 11 ARM64 toolchain on GitHub Actions"

0 commit comments

Comments
 (0)