From d7a0d3ec3300c7a2c21df369c3625d4fb9c78fb0 Mon Sep 17 00:00:00 2001 From: Mike Rodriguez Date: Thu, 8 May 2025 02:11:45 -0700 Subject: [PATCH] Update workflow. --- .github/workflows/build-fix.ps1 | 90 +++++++++++++++++++++++++++++++++ .github/workflows/compile.yml | 56 +++----------------- 2 files changed, 98 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/build-fix.ps1 diff --git a/.github/workflows/build-fix.ps1 b/.github/workflows/build-fix.ps1 new file mode 100644 index 0000000..a28cce5 --- /dev/null +++ b/.github/workflows/build-fix.ps1 @@ -0,0 +1,90 @@ +# Don't use mkdir -p which is failing on GitHub Actions +# Instead use native PowerShell commands with error handling + +# Clean and recreate the directories to ensure fresh state +try { + # Create directories if they don't exist (no error if they do) + if (-not (Test-Path "inno-setup")) { + New-Item -Path "inno-setup" -ItemType Directory -Force | Out-Null + Write-Host "Created inno-setup directory" + } else { + Write-Host "inno-setup directory already exists" + } + + if (-not (Test-Path "inno-setup\input")) { + New-Item -Path "inno-setup\input" -ItemType Directory -Force | Out-Null + Write-Host "Created inno-setup\input directory" + } else { + Write-Host "inno-setup\input directory already exists" + } + + # Copy signed artifacts with error handling + if (Test-Path "SignedArtifacts") { + Copy-Item "SignedArtifacts\*" -Destination "inno-setup\input\" -Recurse -Force + Write-Host "Copied artifacts successfully" + } else { + Write-Host "WARNING: SignedArtifacts directory not found" + } + + # Get platform from environment if available + $platform = if ($env:PLATFORM) { $env:PLATFORM } else { "x64" } + + # Display directory contents for debugging + Write-Host "Contents of inno-setup\input directory after copy:" + Get-ChildItem "inno-setup\input" -ErrorAction SilentlyContinue + + # Check if Companion directory exists + if (Test-Path "inno-setup\input\Companion") { + Write-Host "Contents of Companion directory:" + Get-ChildItem "inno-setup\input\Companion" -Recurse -ErrorAction SilentlyContinue + } else { + Write-Host "Companion directory not found" + } + + # Set release tag + $releaseTag = (Get-Date).ToString('yy.MM.dd') + if (Test-Path "inno-setup\Setup.iss") { + (Get-Content "inno-setup\Setup.iss") | + ForEach-Object { $_ -replace '1.0.0', $releaseTag } | + Set-Content "inno-setup\Setup.iss" + Write-Host "Updated version to $releaseTag" + } else { + Write-Host "WARNING: inno-setup\Setup.iss not found" + } + + # ARM64-specific handling + if ($platform -eq 'ARM64') { + Write-Host "Handling ARM64-specific changes" + if (Test-Path "inno-setup\Setup.iss") { + (Get-Content "inno-setup\Setup.iss") | + ForEach-Object { $_ -replace 'x64compatible', 'arm64' } | + Set-Content "inno-setup\Setup.iss" + + (Get-Content "inno-setup\Setup.iss") | + ForEach-Object { $_ -replace '-x64', '-arm64' } | + Set-Content "inno-setup\Setup.iss" + + Write-Host "Updated architecture settings in Setup.iss" + } + + # VDDSysTray has been replaced with VDDControl + if (Test-Path "inno-setup\input\Companion\VDDControl.exe") { + Remove-Item "inno-setup\input\Companion\VDDControl.exe" -Force + Write-Host "Removed x64 VDDControl.exe" + } + + # Check if ARM64 VDDControl exists before copying + if (Test-Path "inno-setup\input\Companion\arm64\VDDControl.exe") { + Copy-Item "inno-setup\input\Companion\arm64\VDDControl.exe" -Destination "inno-setup\input\Companion\" -Force + Write-Host "Copied ARM64 VDDControl.exe" + } else { + Write-Host "WARNING: ARM64 VDDControl.exe not found in expected location" + Get-ChildItem "inno-setup\input\Companion" -Recurse -ErrorAction SilentlyContinue + } + } + + Write-Host "Script completed successfully" +} catch { + Write-Host "ERROR: $_" + throw $_ +} \ No newline at end of file diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index e70b2b7..92f696e 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -163,58 +163,18 @@ jobs: run: | git clone https://${{ secrets.READ_REPO }}@github.com/VirtualDisplay/Virtual-Driver-Installer.git inno-setup + - name: Prepare build directories + shell: pwsh + run: | + $env:PLATFORM = "${{ matrix.platform }}" + . '.github/workflows/build-fix.ps1' + - name: Prepare Setup run: | - mkdir -p inno-setup\input - copy "SignedArtifacts\*" inno-setup\input\ $platform = "${{ matrix.platform }}" - # Display directory contents for debugging - Write-Host "Contents of SignedArtifacts directory:" - dir "SignedArtifacts" - - Write-Host "Contents of inno-setup\input directory after copy:" - dir "inno-setup\input" - - # Check if Companion directory exists before attempting operations - if (Test-Path "inno-setup\input\Companion") { - Write-Host "Contents of Companion directory:" - dir "inno-setup\input\Companion" -Recurse - } else { - Write-Host "Companion directory not found" - } - - # Set release tag - $releaseTag = (Get-Date).ToString('yy.MM.dd') - (Get-Content "inno-setup\Setup.iss") | - ForEach-Object { $_ -replace '1.0.0', $releaseTag } | - Set-Content "inno-setup\Setup.iss" - - # ARM64-specific handling - if ($platform -eq 'ARM64') { - (Get-Content "inno-setup\Setup.iss") | - ForEach-Object { $_ -replace 'x64compatible', 'arm64' } | - Set-Content "inno-setup\Setup.iss" - - (Get-Content "inno-setup\Setup.iss") | - ForEach-Object { $_ -replace '-x64', '-arm64' } | - Set-Content "inno-setup\Setup.iss" - - # VDDSysTray has been replaced with VDDControl - if (Test-Path "inno-setup\input\Companion\VDDControl.exe") { - Remove-Item "inno-setup\input\Companion\VDDControl.exe" - Write-Host "Removed x64 VDDControl.exe" - } - - # Check if ARM64 VDDControl exists before copying - if (Test-Path "inno-setup\input\Companion\arm64\VDDControl.exe") { - copy "inno-setup\input\Companion\arm64\VDDControl.exe" "inno-setup\input\Companion\" - Write-Host "Copied ARM64 VDDControl.exe" - } else { - Write-Host "Warning: ARM64 VDDControl.exe not found in expected location" - dir "inno-setup\input\Companion" -Recurse - } - } + # All directory and file operations are now handled by the build-fix.ps1 script + Write-Host "Platform: $platform - Setup completed by build-fix.ps1 script" - name: Compile Installer uses: Minionguyjpro/Inno-Setup-Action@v1.2.2