diff --git a/.github/workflows/build-and-sign-sequential.yml b/.github/workflows/build-and-sign-sequential.yml deleted file mode 100644 index 5c48d39..0000000 --- a/.github/workflows/build-and-sign-sequential.yml +++ /dev/null @@ -1,545 +0,0 @@ -name: Build and Sign Virtual Drivers - Sequential - -on: - push: - branches: [ main, master ] - paths-ignore: - - '**.md' - - 'docs/**' - - '.github/workflows/ci-validation.yml' - - '.github/workflows/build-installer.yml' - workflow_dispatch: - inputs: - skip_signing: - description: 'Skip SignPath signing (for testing)' - required: false - default: false - type: boolean - release: - types: [created] - schedule: - - cron: '0 2 * * 0' # Weekly builds - -env: - BUILD_CONFIGURATION: Release - -permissions: - contents: read - actions: write - -jobs: - # Single Sequential Job - Build everything in specified order - build-sequential: - runs-on: windows-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # Setup build environment - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - - name: Install Windows Driver Kit (for IddCx headers) - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - choco install windowsdriverkit11 -y --no-progress - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - - - name: Detect Windows SDK (windows.h) - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - - $kitsRoot = $null - try { - $kitsRoot = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10 - } catch { - $kitsRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\" - } - - if (-not $kitsRoot -or -not (Test-Path $kitsRoot)) { - throw "Windows Kits root not found: $kitsRoot" - } - - $includeRoot = Join-Path $kitsRoot "Include" - if (-not (Test-Path $includeRoot)) { - throw "Windows Kits Include directory not found: $includeRoot" - } - - $best = - Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | - Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | - Where-Object { Test-Path (Join-Path $_.FullName "um\Windows.h") } | - Sort-Object -Property Name -Descending | - Select-Object -First 1 - - if (-not $best) { - throw "Could not find an SDK version directory containing um\\Windows.h under: $includeRoot" - } - - $sdkVersion = $best.Name - Write-Output "Using WindowsSdkDir: $kitsRoot" - Write-Output "Using WindowsTargetPlatformVersion: $sdkVersion" - "WINDOWS_SDK_DIR=$kitsRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - "WINDOWS_TARGET_PLATFORM_VERSION=$sdkVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Debug IddCx header location - shell: pwsh - run: | - $ErrorActionPreference = "Continue" - $base = Join-Path $env:WINDOWS_SDK_DIR ("Include\" + $env:WINDOWS_TARGET_PLATFORM_VERSION + "\um\iddcx") - Write-Output "IddCx base: $base" - if (Test-Path $base) { - Get-ChildItem -Path $base -Directory -ErrorAction SilentlyContinue | ForEach-Object { Write-Output ("- " + $_.Name) } - Get-ChildItem -Path $base -Recurse -Filter "IddCx.h" -ErrorAction SilentlyContinue | Select-Object -First 20 | ForEach-Object { Write-Output ("Found: " + $_.FullName) } - } else { - Write-Output "IddCx base directory not found." - } - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '6.0.x' - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - # STEP 1: Build ARM64 Virtual Display Driver - - name: "Step 1: Build ARM64 Virtual Display Driver" - run: | - Write-Output "=== STEP 1: Building ARM64 Virtual Display Driver ===" - $vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln" - if (Test-Path $vddSln) { - Write-Output "Found VDD solution: $vddSln" - msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal - if ($LASTEXITCODE -eq 0) { - Write-Output "✅ ARM64 VDD build completed successfully" - - # Verify build output - $buildDir = "Virtual Display Driver (HDR)\ARM64\$env:BUILD_CONFIGURATION\MttVDD" - if (Test-Path $buildDir) { - Write-Output "ARM64 VDD Build outputs:" - Get-ChildItem $buildDir | ForEach-Object { Write-Output " - $($_.Name)" } - } else { - Write-Output "❌ ARM64 VDD build directory not found: ${buildDir}" - exit 1 - } - } else { - Write-Output "❌ ARM64 VDD build failed with exit code: $LASTEXITCODE" - exit 1 - } - } else { - Write-Output "❌ VDD solution file not found at: $vddSln" - exit 1 - } - - # STEP 2: Build ARM64 Virtual Audio Driver (Skip validation to avoid WDK tool conflicts) - - name: "Step 2: Build ARM64 Virtual Audio Driver" - run: | - Write-Output "=== STEP 2: Building ARM64 Virtual Audio Driver ===" - Write-Output "⚠️ Note: ARM64 VAD build requires disabling validation due to WDK x86 tool limitations" - - $vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln" - if (Test-Path $vadSln) { - Write-Output "Found VAD solution: $vadSln" - Write-Output "Building ARM64 VAD with validation disabled..." - - # Build with validation disabled to avoid x86 tool conflicts with ARM64 outputs - msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=ARM64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /p:EnableInfVerif=false /p:RunApiValidator=false /verbosity:minimal - - if ($LASTEXITCODE -eq 0) { - Write-Output "✅ ARM64 VAD build completed successfully!" - - # Search for ARM64 VAD outputs - Write-Output "ARM64 VAD Build outputs:" - Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Include "*.sys", "*.inf", "*.cat", "*.dll" -ErrorAction SilentlyContinue | - Where-Object { $_.FullName -like "*ARM64*" } | ForEach-Object { - Write-Output " - $($_.FullName)" - } - } else { - Write-Output "❌ ARM64 VAD build failed with exit code: $LASTEXITCODE" - Write-Output "ℹ️ Continuing with build process - ARM64 VAD will be skipped" - } - } else { - Write-Output "❌ VAD solution file not found at: $vadSln" - Write-Output "ℹ️ Continuing with build process - ARM64 VAD will be skipped" - } - continue-on-error: true - - # STEP 3: Build x64 Virtual Display Driver - - name: "Step 3: Build x64 Virtual Display Driver" - run: | - Write-Output "=== STEP 3: Building x64 Virtual Display Driver ===" - $vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln" - if (Test-Path $vddSln) { - Write-Output "Found VDD solution: $vddSln" - msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal - if ($LASTEXITCODE -eq 0) { - Write-Output "✅ x64 VDD build completed successfully" - - # Verify build output - $buildDir = "Virtual Display Driver (HDR)\x64\$env:BUILD_CONFIGURATION\MttVDD" - if (Test-Path $buildDir) { - Write-Output "x64 VDD Build outputs:" - Get-ChildItem $buildDir | ForEach-Object { Write-Output " - $($_.Name)" } - } else { - Write-Output "❌ x64 VDD build directory not found: ${buildDir}" - exit 1 - } - } else { - Write-Output "❌ x64 VDD build failed with exit code: $LASTEXITCODE" - exit 1 - } - } else { - Write-Output "❌ VDD solution file not found at: $vddSln" - exit 1 - } - - # STEP 4: Build x64 Virtual Audio Driver - - name: "Step 4: Build x64 Virtual Audio Driver" - run: | - Write-Output "=== STEP 4: Building x64 Virtual Audio Driver ===" - $vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln" - if (Test-Path $vadSln) { - Write-Output "Found VAD solution: $vadSln" - msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal - if ($LASTEXITCODE -eq 0) { - Write-Output "✅ x64 VAD build completed successfully" - - # List build outputs - Write-Output "x64 VAD Build outputs:" - Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Include "*.sys", "*.inf", "*.cat", "*.dll" -ErrorAction SilentlyContinue | ForEach-Object { - Write-Output " - $($_.FullName)" - } - } else { - Write-Output "❌ x64 VAD build failed with exit code: $LASTEXITCODE" - exit 1 - } - } else { - Write-Output "❌ VAD solution file not found at: $vadSln" - exit 1 - } - - # STEP 5: Build Control App - - name: "Step 5: Build Control App" - run: | - Write-Output "=== STEP 5: Building Control App ===" - - # Create final build directories - New-Item -ItemType Directory -Path "final-build" -Force - New-Item -ItemType Directory -Path "final-build\ARM64" -Force - New-Item -ItemType Directory -Path "final-build\x64" -Force - New-Item -ItemType Directory -Path "final-build\ControlApp" -Force - New-Item -ItemType Directory -Path "final-build\ControlApp-ARM64" -Force - - # Checkout Virtual Driver Control Repository - - name: Checkout Virtual Driver Control Repository - if: github.repository != 'VirtualDrivers/Virtual-Driver-Control' - uses: actions/checkout@v4 - with: - repository: 'VirtualDrivers/Virtual-Driver-Control' - path: 'control-app-repo' - token: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - - - name: Build Virtual Driver Control App - run: | - $controlAppPath = "" - - if (Test-Path "control-app-repo/VirtualDriverControl/package.json") { - $controlAppPath = "control-app-repo/VirtualDriverControl" - Write-Output "Found control app in separate repository" - } - - if ($controlAppPath -ne "") { - Write-Output "Building Virtual Driver Control App..." - - # Build for x64 (primary target) - Write-Output "Building for x64..." - $x64BuildPath = "control-app-x64" - Copy-Item $controlAppPath -Destination $x64BuildPath -Recurse -Force - Push-Location $x64BuildPath - npm ci - npm run build-portable - Pop-Location - - if (Test-Path "$x64BuildPath/dist") { - Copy-Item "$x64BuildPath/dist/*" -Destination "final-build/ControlApp/" -Recurse -Force - Write-Output "✅ x64 Control App build completed" - } else { - Write-Output "❌ x64 Control App build failed - no dist directory" - exit 1 - } - - # Build for ARM64 - Write-Output "Building for ARM64..." - $arm64BuildPath = "control-app-arm64" - Copy-Item $controlAppPath -Destination $arm64BuildPath -Recurse -Force - Push-Location $arm64BuildPath - npm ci - - # Modify package.json for ARM64 - $packageJson = Get-Content "package.json" | ConvertFrom-Json - $packageJson.build.win.target[0].arch = @("arm64") - $packageJson | ConvertTo-Json -Depth 10 | Set-Content "package.json" - - npm run build-portable - Pop-Location - - if (Test-Path "$arm64BuildPath/dist") { - # Store ARM64 version separately for reference - Copy-Item "$arm64BuildPath/dist/*" -Destination "final-build/ControlApp-ARM64/" -Recurse -Force - Write-Output "✅ ARM64 Control App build completed" - } else { - Write-Output "⚠️ ARM64 Control App build failed - continuing with x64 version only" - } - } else { - Write-Output "❌ Virtual Driver Control App not found" - exit 1 - } - - # STEP 6: Build Installer - - name: "Step 6: Build Installer" - run: | - Write-Output "=== STEP 6: Building Installer ===" - - # Copy built components to final structure - Write-Output "Organizing built components..." - - # Copy ARM64 VDD - $arm64VddDir = "Virtual Display Driver (HDR)\ARM64\$env:BUILD_CONFIGURATION\MttVDD" - if (Test-Path $arm64VddDir) { - Copy-Item "$arm64VddDir\*" -Destination "final-build\ARM64\" -Force - Write-Output "✅ Copied ARM64 VDD files" - } - - # Copy ARM64 VAD (if it was successfully built) - $arm64VadFiles = Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Include "*.sys", "*.inf", "*.cat", "*.dll" -ErrorAction SilentlyContinue | - Where-Object { $_.FullName -like "*ARM64*" } - if ($arm64VadFiles) { - foreach ($file in $arm64VadFiles) { - Copy-Item $file.FullName -Destination "final-build\ARM64\" -Force - } - Write-Output "✅ Copied ARM64 VAD files" - } else { - Write-Output "ℹ️ No ARM64 VAD files found (build may have failed)" - } - - # Copy x64 VDD - $x64VddDir = "Virtual Display Driver (HDR)\x64\$env:BUILD_CONFIGURATION\MttVDD" - if (Test-Path $x64VddDir) { - Copy-Item "$x64VddDir\*" -Destination "final-build\x64\" -Force - Write-Output "✅ Copied x64 VDD files" - } - - # Copy x64 VAD - $vadFiles = Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Include "*.sys", "*.inf", "*.cat", "*.dll" -ErrorAction SilentlyContinue - foreach ($file in $vadFiles) { - Copy-Item $file.FullName -Destination "final-build\x64\" -Force - } - Write-Output "✅ Copied x64 VAD files" - - # Checkout installer repository - - name: Checkout Virtual Driver Installer Repository - uses: actions/checkout@v4 - with: - repository: 'VirtualDrivers/Virtual-Driver-Installer' - path: 'installer-repo' - token: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - - - name: Build Installer with Components - run: | - Write-Output "Building installer with all components..." - - $installerPath = "installer-repo" - if (Test-Path $installerPath) { - Push-Location $installerPath - - # Ensure Inno Setup is available for iscc - if (-not (Get-Command iscc -ErrorAction SilentlyContinue)) { - Write-Output "Installing Inno Setup..." - choco install innosetup -y --no-progress - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - } - - # Generate release tag - $releaseTag = (Get-Date).ToString('yy.MM.dd') - Write-Output "Using release tag: $releaseTag" - - # Update version in Setup.iss - if (Test-Path "Setup.iss") { - $setupContent = Get-Content "Setup.iss" - $setupContent = $setupContent -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$releaseTag`"" - $setupContent = $setupContent -replace 'OutputBaseFilename=.*', "OutputBaseFilename=Virtual-Driver-Control-v$releaseTag-setup-mixed-platform" - $setupContent | Set-Content "Setup.iss" - Write-Output "Updated Setup.iss with version: $releaseTag" - } - - # Run preparation script if it exists - if (Test-Path "build-installer.ps1") { - Write-Output "Running installer preparation script..." - .\build-installer.ps1 - } - - # Compile installer - Write-Output "Compiling installer with Inno Setup..." - if (Test-Path "Setup.iss") { - iscc Setup.iss - if ($LASTEXITCODE -eq 0) { - Write-Output "✅ Installer compilation completed" - - if (Test-Path "output\*.exe") { - $installerFile = Get-ChildItem "output\*.exe" | Select-Object -First 1 - Write-Output "✅ Installer built successfully: $($installerFile.Name)" - Write-Output "INSTALLER_NAME=$($installerFile.Name)" >> $env:GITHUB_ENV - Write-Output "RELEASE_TAG=$releaseTag" >> $env:GITHUB_ENV - } else { - Write-Output "❌ No installer executable found" - exit 1 - } - } else { - Write-Output "❌ Installer compilation failed" - exit 1 - } - } else { - Write-Output "❌ Setup.iss not found" - exit 1 - } - - Pop-Location - } else { - Write-Output "❌ Installer repository not found" - exit 1 - } - - # STEP 7: Create final ZIP package - - name: "Step 7: Create Final ZIP Package" - run: | - Write-Output "=== STEP 7: Creating Final ZIP Package ===" - - # Create comprehensive package directory - $packageDir = "virtual-driver-complete-package" - New-Item -ItemType Directory -Path $packageDir -Force - - # Copy all built components - Write-Output "Packaging all components..." - - # Copy final build components - if (Test-Path "final-build") { - Copy-Item "final-build\*" -Destination "$packageDir\" -Recurse -Force - Write-Output "✅ Copied all driver and control app components" - } - - # Copy installer - if (Test-Path "installer-repo\output\*.exe") { - Copy-Item "installer-repo\output\*.exe" -Destination "$packageDir\" -Force - Write-Output "✅ Copied installer executable" - } - - # Create ZIP file - $zipFile = "Virtual-Driver-Complete-Package-${{ env.RELEASE_TAG }}.zip" - Write-Output "Creating ZIP package: $zipFile" - Compress-Archive -Path $packageDir -DestinationPath $zipFile -Force - - if (Test-Path $zipFile) { - $zipSize = (Get-Item $zipFile).Length - Write-Output "✅ Complete package created: $zipFile ($(($zipSize / 1MB).ToString('F2')) MB)" - Write-Output "PACKAGE_ZIP=$zipFile" >> $env:GITHUB_ENV - - # List package contents - Write-Output "" - Write-Output "=== Package Contents ===" - Get-ChildItem $packageDir -Recurse | ForEach-Object { - $relativePath = $_.FullName.Substring($packageDir.Length + 1) - if ($_.PSIsContainer) { - Write-Output "📁 $relativePath/" - } else { - Write-Output "📄 $relativePath" - } - } - } else { - Write-Output "❌ Failed to create ZIP package" - exit 1 - } - - # Upload complete package - - name: Upload Complete Package - uses: actions/upload-artifact@v4 - with: - name: Virtual-Driver-Complete-Package-${{ env.RELEASE_TAG }} - path: ${{ env.PACKAGE_ZIP }} - retention-days: 30 - - # Upload ZIP for SignPath - - name: Upload ZIP for SignPath - id: upload_for_signpath - uses: actions/upload-artifact@v4 - with: - name: Package-For-SignPath-${{ env.RELEASE_TAG }} - path: ${{ env.PACKAGE_ZIP }} - retention-days: 1 - - # STEP 8: Submit to SignPath - - name: "Step 8: Submit to SignPath" - if: github.event.inputs.skip_signing != 'true' && steps.upload_for_signpath.outputs.artifact-id != '' - id: signpath_request - uses: signpath/github-action-submit-signing-request@v1 - with: - api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' - organization-id: '${{ vars.SIGNPATH_ORG_ID }}' - project-slug: '${{ vars.SIGNPATH_PROJECT_SLUG }}' - signing-policy-slug: '${{ vars.SIGNPATH_POLICY_SLUG }}' - github-artifact-id: '${{ steps.upload_for_signpath.outputs.artifact-id }}' - wait-for-completion: true - output-artifact-directory: 'signed-output' - parameters: | - Version=${{ env.RELEASE_TAG }} - Platforms=ARM64-VDD,x64-VDD-VAD,ControlApp,Installer - continue-on-error: true - - # Upload signed package - - name: Upload Signed Package - if: steps.signpath_request.outcome == 'success' - uses: actions/upload-artifact@v4 - with: - name: Virtual-Driver-Signed-Package-${{ env.RELEASE_TAG }} - path: signed-output/ - retention-days: 90 - continue-on-error: true - - # Build Summary - - name: Sequential Build Summary - if: always() - run: | - Write-Output "=== Virtual Drivers Sequential Build Summary ===" - Write-Output "Release Tag: ${{ env.RELEASE_TAG }}" - Write-Output "Configuration: $env:BUILD_CONFIGURATION" - Write-Output "Commit: ${{ github.sha }}" - Write-Output "Branch/Tag: ${{ github.ref }}" - Write-Output "" - Write-Output "Sequential Build Order Completed:" - Write-Output "1️⃣ ARM64 Virtual Display Driver ✅" - Write-Output "2️⃣ ARM64 Virtual Audio Driver ✅ (validation disabled for WDK compatibility)" - Write-Output "3️⃣ x64 Virtual Display Driver ✅" - Write-Output "4️⃣ x64 Virtual Audio Driver ✅" - Write-Output "5️⃣ Control App (x64 + ARM64) ✅" - Write-Output "6️⃣ Installer ✅" - Write-Output "7️⃣ ZIP Package ✅" - Write-Output "8️⃣ SignPath Submission $(if ('${{ steps.signpath_request.outcome }}' -eq 'success') { '✅' } elseif ('${{ github.event.inputs.skip_signing }}' -eq 'true') { '⏭️ (skipped by input)' } elseif ('${{ steps.upload_for_signpath.outputs.artifact-id }}' -eq '') { '⏭️ (no artifact uploaded)' } else { '❌' })" - Write-Output "" - Write-Output "Artifacts Created:" - Write-Output "• Virtual-Driver-Complete-Package-${{ env.RELEASE_TAG }}" - if ('${{ steps.signpath_request.outcome }}' -eq 'success') { - Write-Output "• Virtual-Driver-Signed-Package-${{ env.RELEASE_TAG }}" - } - Write-Output "" - Write-Output "Package includes:" - Write-Output "📁 ARM64/ - ARM64 Virtual Display Driver" - Write-Output "📁 x64/ - x64 Virtual Display + Audio Drivers" - Write-Output "📁 ControlApp/ - Virtual Driver Control Application" - Write-Output "📄 ${{ env.INSTALLER_NAME }} - Complete Installer" \ No newline at end of file diff --git a/.github/workflows/build-installer.yml b/.github/workflows/build-installer.yml deleted file mode 100644 index f4f52bc..0000000 --- a/.github/workflows/build-installer.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: Build Installer Only - -on: - workflow_dispatch: - inputs: - installer_variant: - description: 'Installer variant to build' - required: true - default: 'mixed' - type: choice - options: - - mixed - - x64-only - - arm64-only - version_override: - description: 'Override version (format: YY.MM.DD)' - required: false - type: string - schedule: - - cron: '0 6 * * 1' # Weekly on Monday morning - -env: - BUILD_CONFIGURATION: Release - -permissions: - contents: read - actions: write - -jobs: - build-installer: - runs-on: windows-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Version - shell: pwsh - run: | - $version = "${{ github.event.inputs.version_override }}" - if ([string]::IsNullOrEmpty($version)) { - $version = (Get-Date).ToString('yy.MM.dd') - } - "INSTALLER_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "Using version: $version" - - $variant = "${{ github.event.inputs.installer_variant }}" - if ([string]::IsNullOrEmpty($variant)) { $variant = "mixed" } - "INSTALLER_VARIANT=$variant" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "Building installer variant: $variant" - - - name: Checkout Virtual Driver Installer Repository - uses: actions/checkout@v4 - with: - repository: 'VirtualDrivers/Virtual-Driver-Installer' - path: 'installer-repo' - token: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - - - name: Build Installer - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - Write-Output "=== Building Virtual Driver Installer ===" - Write-Output "Variant: $env:INSTALLER_VARIANT" - Write-Output "Version: $env:INSTALLER_VERSION" - - if (-not (Test-Path "installer-repo")) { - throw "Installer repository checkout not found (installer-repo)." - } - - Push-Location installer-repo - - if (-not (Get-Command iscc -ErrorAction SilentlyContinue)) { - Write-Output "Installing Inno Setup..." - choco install innosetup -y --no-progress - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - } - - if (Test-Path "Setup.iss") { - $setupContent = Get-Content "Setup.iss" - $setupContent = $setupContent -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$env:INSTALLER_VERSION`"" - - switch ($env:INSTALLER_VARIANT) { - "x64-only" { - $setupContent = $setupContent -replace 'OutputBaseFilename=.*', "OutputBaseFilename=Virtual-Driver-Control-v$env:INSTALLER_VERSION-setup-x64-only" - } - "arm64-only" { - $setupContent = $setupContent -replace 'OutputBaseFilename=.*', "OutputBaseFilename=Virtual-Driver-Control-v$env:INSTALLER_VERSION-setup-arm64-only" - } - default { - $setupContent = $setupContent -replace 'OutputBaseFilename=.*', "OutputBaseFilename=Virtual-Driver-Control-v$env:INSTALLER_VERSION-setup-mixed-platform" - } - } - - $setupContent | Set-Content "Setup.iss" - } else { - throw "Setup.iss not found in installer repo." - } - - if (Test-Path "build-installer.ps1") { - Write-Output "Running installer preparation script..." - .\build-installer.ps1 - } - - Write-Output "Compiling installer with Inno Setup..." - iscc Setup.iss - - if ($LASTEXITCODE -ne 0) { throw "Inno Setup compilation failed." } - if (-not (Test-Path "output\\*.exe")) { throw "No installer EXE found under output\\." } - - $installerFile = Get-ChildItem "output\\*.exe" | Select-Object -First 1 - Write-Output "✅ Installer built successfully: $($installerFile.Name)" - "INSTALLER_NAME=$($installerFile.Name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - Pop-Location - - - name: Upload Installer - uses: actions/upload-artifact@v4 - with: - name: Virtual-Driver-Installer-${{ env.INSTALLER_VERSION }}-${{ env.INSTALLER_VARIANT }} - path: installer-repo/output/*.exe - retention-days: 30 - diff --git a/.github/workflows/ci-validation.yml b/.github/workflows/ci-validation.yml index 4c4ea7f..eea23dd 100644 --- a/.github/workflows/ci-validation.yml +++ b/.github/workflows/ci-validation.yml @@ -1,4 +1,4 @@ -name: Fast CI Validation +name: Build Virtual Display Driver on: pull_request: @@ -9,107 +9,107 @@ on: - '**.md' - 'docs/**' - 'LICENSE*' + workflow_dispatch: env: BUILD_CONFIGURATION: Release + VDD_SOLUTION: Virtual Display Driver (HDR)/MttVDD.sln permissions: contents: read jobs: - validate: + build: runs-on: windows-latest + strategy: + fail-fast: false + matrix: + platform: [x64, ARM64] steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 - - name: Install Windows Driver Kit (for IddCx headers) - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - choco install windowsdriverkit11 -y --no-progress - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Install Windows Driver Kit (IddCx headers) + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + choco install windowsdriverkit11 -y --no-progress + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - - name: Detect Windows SDK (windows.h) - shell: pwsh - run: | - $ErrorActionPreference = "Stop" + - name: Detect Windows SDK (windows.h) + shell: pwsh + run: | + $ErrorActionPreference = "Stop" - $kitsRoot = $null - try { - $kitsRoot = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10 - } catch { - $kitsRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\" - } + $kitsRoot = $null + try { + $kitsRoot = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name "KitsRoot10" -ErrorAction Stop).KitsRoot10 + } catch { + $kitsRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\" + } - if (-not $kitsRoot -or -not (Test-Path $kitsRoot)) { - throw "Windows Kits root not found: $kitsRoot" - } + if (-not $kitsRoot -or -not (Test-Path $kitsRoot)) { + throw "Windows Kits root not found: $kitsRoot" + } - $includeRoot = Join-Path $kitsRoot "Include" - if (-not (Test-Path $includeRoot)) { - throw "Windows Kits Include directory not found: $includeRoot" - } + $includeRoot = Join-Path $kitsRoot "Include" + if (-not (Test-Path $includeRoot)) { + throw "Windows Kits Include directory not found: $includeRoot" + } - $best = - Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | - Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | - Where-Object { Test-Path (Join-Path $_.FullName "um\Windows.h") } | - Sort-Object -Property Name -Descending | - Select-Object -First 1 + $best = + Get-ChildItem -Path $includeRoot -Directory -ErrorAction SilentlyContinue | + Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | + Where-Object { Test-Path (Join-Path $_.FullName "um\Windows.h") } | + Sort-Object -Property Name -Descending | + Select-Object -First 1 - if (-not $best) { - throw "Could not find an SDK version directory containing um\\Windows.h under: $includeRoot" - } + if (-not $best) { + throw "Could not find an SDK version directory containing um\\Windows.h under: $includeRoot" + } - $sdkVersion = $best.Name - Write-Output "Using WindowsSdkDir: $kitsRoot" - Write-Output "Using WindowsTargetPlatformVersion: $sdkVersion" - "WINDOWS_SDK_DIR=$kitsRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - "WINDOWS_TARGET_PLATFORM_VERSION=$sdkVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + $sdkVersion = $best.Name + Write-Output "Using WindowsSdkDir: $kitsRoot" + Write-Output "Using WindowsTargetPlatformVersion: $sdkVersion" + "WINDOWS_SDK_DIR=$kitsRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + "WINDOWS_TARGET_PLATFORM_VERSION=$sdkVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Debug IddCx header location - shell: pwsh - run: | - $ErrorActionPreference = "Continue" - $base = Join-Path $env:WINDOWS_SDK_DIR ("Include\" + $env:WINDOWS_TARGET_PLATFORM_VERSION + "\um\iddcx") - Write-Output "IddCx base: $base" - if (Test-Path $base) { - Get-ChildItem -Path $base -Directory -ErrorAction SilentlyContinue | ForEach-Object { Write-Output ("- " + $_.Name) } - Get-ChildItem -Path $base -Recurse -Filter "IddCx.h" -ErrorAction SilentlyContinue | Select-Object -First 20 | ForEach-Object { Write-Output ("Found: " + $_.FullName) } - } else { - Write-Output "IddCx base directory not found." - } + - name: Build VDD (${{ matrix.platform }}) + shell: pwsh + run: | + $ErrorActionPreference = "Stop" - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' + $sln = "${{ env.VDD_SOLUTION }}" + if (-not (Test-Path $sln)) { throw "VDD solution file not found at: $sln" } - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '6.0.x' + msbuild $sln ` + /m ` + /t:Build ` + /p:Configuration="${{ env.BUILD_CONFIGURATION }}" ` + /p:Platform="${{ matrix.platform }}" ` + /p:WindowsSdkDir="$env:WINDOWS_SDK_DIR" ` + /p:WindowsTargetPlatformVersion="$env:WINDOWS_TARGET_PLATFORM_VERSION" ` + /verbosity:minimal - - name: Quick VDD Compilation Check - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - Write-Output "Performing quick VDD compilation check..." - $vddSln = "Virtual Display Driver (HDR)/MTTVDD.sln" - if (-not (Test-Path $vddSln)) { throw "VDD solution file not found at: $vddSln" } - msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build + - name: Collect outputs + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $outDir = "Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ env.BUILD_CONFIGURATION }}\MttVDD" + if (-not (Test-Path $outDir)) { throw "Build output directory not found: $outDir" } - - name: Quick VAD Compilation Check - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - Write-Output "Performing quick VAD compilation check..." - $vadSln = "Virtual-Audio-Driver (Latest Stable)/VirtualAudioDriver.sln" - if (-not (Test-Path $vadSln)) { throw "VAD solution file not found at: $vadSln" } - msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=x64 /p:WindowsSdkDir=$env:WINDOWS_SDK_DIR /p:WindowsTargetPlatformVersion=$env:WINDOWS_TARGET_PLATFORM_VERSION /verbosity:minimal /target:Build + $dest = "artifacts\VDD\${{ matrix.platform }}" + New-Item -ItemType Directory -Path $dest -Force | Out-Null + Copy-Item "$outDir\*" -Destination $dest -Recurse -Force + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: VDD-${{ matrix.platform }}-${{ env.BUILD_CONFIGURATION }} + path: artifacts/VDD/${{ matrix.platform }}/ + if-no-files-found: error