Skip to content

Commit d7a0d3e

Browse files
Update workflow.
1 parent 0b8f896 commit d7a0d3e

File tree

2 files changed

+98
-48
lines changed

2 files changed

+98
-48
lines changed

.github/workflows/build-fix.ps1

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Don't use mkdir -p which is failing on GitHub Actions
2+
# Instead use native PowerShell commands with error handling
3+
4+
# Clean and recreate the directories to ensure fresh state
5+
try {
6+
# Create directories if they don't exist (no error if they do)
7+
if (-not (Test-Path "inno-setup")) {
8+
New-Item -Path "inno-setup" -ItemType Directory -Force | Out-Null
9+
Write-Host "Created inno-setup directory"
10+
} else {
11+
Write-Host "inno-setup directory already exists"
12+
}
13+
14+
if (-not (Test-Path "inno-setup\input")) {
15+
New-Item -Path "inno-setup\input" -ItemType Directory -Force | Out-Null
16+
Write-Host "Created inno-setup\input directory"
17+
} else {
18+
Write-Host "inno-setup\input directory already exists"
19+
}
20+
21+
# Copy signed artifacts with error handling
22+
if (Test-Path "SignedArtifacts") {
23+
Copy-Item "SignedArtifacts\*" -Destination "inno-setup\input\" -Recurse -Force
24+
Write-Host "Copied artifacts successfully"
25+
} else {
26+
Write-Host "WARNING: SignedArtifacts directory not found"
27+
}
28+
29+
# Get platform from environment if available
30+
$platform = if ($env:PLATFORM) { $env:PLATFORM } else { "x64" }
31+
32+
# Display directory contents for debugging
33+
Write-Host "Contents of inno-setup\input directory after copy:"
34+
Get-ChildItem "inno-setup\input" -ErrorAction SilentlyContinue
35+
36+
# Check if Companion directory exists
37+
if (Test-Path "inno-setup\input\Companion") {
38+
Write-Host "Contents of Companion directory:"
39+
Get-ChildItem "inno-setup\input\Companion" -Recurse -ErrorAction SilentlyContinue
40+
} else {
41+
Write-Host "Companion directory not found"
42+
}
43+
44+
# Set release tag
45+
$releaseTag = (Get-Date).ToString('yy.MM.dd')
46+
if (Test-Path "inno-setup\Setup.iss") {
47+
(Get-Content "inno-setup\Setup.iss") |
48+
ForEach-Object { $_ -replace '1.0.0', $releaseTag } |
49+
Set-Content "inno-setup\Setup.iss"
50+
Write-Host "Updated version to $releaseTag"
51+
} else {
52+
Write-Host "WARNING: inno-setup\Setup.iss not found"
53+
}
54+
55+
# ARM64-specific handling
56+
if ($platform -eq 'ARM64') {
57+
Write-Host "Handling ARM64-specific changes"
58+
if (Test-Path "inno-setup\Setup.iss") {
59+
(Get-Content "inno-setup\Setup.iss") |
60+
ForEach-Object { $_ -replace 'x64compatible', 'arm64' } |
61+
Set-Content "inno-setup\Setup.iss"
62+
63+
(Get-Content "inno-setup\Setup.iss") |
64+
ForEach-Object { $_ -replace '-x64', '-arm64' } |
65+
Set-Content "inno-setup\Setup.iss"
66+
67+
Write-Host "Updated architecture settings in Setup.iss"
68+
}
69+
70+
# VDDSysTray has been replaced with VDDControl
71+
if (Test-Path "inno-setup\input\Companion\VDDControl.exe") {
72+
Remove-Item "inno-setup\input\Companion\VDDControl.exe" -Force
73+
Write-Host "Removed x64 VDDControl.exe"
74+
}
75+
76+
# Check if ARM64 VDDControl exists before copying
77+
if (Test-Path "inno-setup\input\Companion\arm64\VDDControl.exe") {
78+
Copy-Item "inno-setup\input\Companion\arm64\VDDControl.exe" -Destination "inno-setup\input\Companion\" -Force
79+
Write-Host "Copied ARM64 VDDControl.exe"
80+
} else {
81+
Write-Host "WARNING: ARM64 VDDControl.exe not found in expected location"
82+
Get-ChildItem "inno-setup\input\Companion" -Recurse -ErrorAction SilentlyContinue
83+
}
84+
}
85+
86+
Write-Host "Script completed successfully"
87+
} catch {
88+
Write-Host "ERROR: $_"
89+
throw $_
90+
}

.github/workflows/compile.yml

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -163,58 +163,18 @@ jobs:
163163
run: |
164164
git clone https://${{ secrets.READ_REPO }}@github.com/VirtualDisplay/Virtual-Driver-Installer.git inno-setup
165165
166+
- name: Prepare build directories
167+
shell: pwsh
168+
run: |
169+
$env:PLATFORM = "${{ matrix.platform }}"
170+
. '.github/workflows/build-fix.ps1'
171+
166172
- name: Prepare Setup
167173
run: |
168-
mkdir -p inno-setup\input
169-
copy "SignedArtifacts\*" inno-setup\input\
170174
$platform = "${{ matrix.platform }}"
171175
172-
# Display directory contents for debugging
173-
Write-Host "Contents of SignedArtifacts directory:"
174-
dir "SignedArtifacts"
175-
176-
Write-Host "Contents of inno-setup\input directory after copy:"
177-
dir "inno-setup\input"
178-
179-
# Check if Companion directory exists before attempting operations
180-
if (Test-Path "inno-setup\input\Companion") {
181-
Write-Host "Contents of Companion directory:"
182-
dir "inno-setup\input\Companion" -Recurse
183-
} else {
184-
Write-Host "Companion directory not found"
185-
}
186-
187-
# Set release tag
188-
$releaseTag = (Get-Date).ToString('yy.MM.dd')
189-
(Get-Content "inno-setup\Setup.iss") |
190-
ForEach-Object { $_ -replace '1.0.0', $releaseTag } |
191-
Set-Content "inno-setup\Setup.iss"
192-
193-
# ARM64-specific handling
194-
if ($platform -eq 'ARM64') {
195-
(Get-Content "inno-setup\Setup.iss") |
196-
ForEach-Object { $_ -replace 'x64compatible', 'arm64' } |
197-
Set-Content "inno-setup\Setup.iss"
198-
199-
(Get-Content "inno-setup\Setup.iss") |
200-
ForEach-Object { $_ -replace '-x64', '-arm64' } |
201-
Set-Content "inno-setup\Setup.iss"
202-
203-
# VDDSysTray has been replaced with VDDControl
204-
if (Test-Path "inno-setup\input\Companion\VDDControl.exe") {
205-
Remove-Item "inno-setup\input\Companion\VDDControl.exe"
206-
Write-Host "Removed x64 VDDControl.exe"
207-
}
208-
209-
# Check if ARM64 VDDControl exists before copying
210-
if (Test-Path "inno-setup\input\Companion\arm64\VDDControl.exe") {
211-
copy "inno-setup\input\Companion\arm64\VDDControl.exe" "inno-setup\input\Companion\"
212-
Write-Host "Copied ARM64 VDDControl.exe"
213-
} else {
214-
Write-Host "Warning: ARM64 VDDControl.exe not found in expected location"
215-
dir "inno-setup\input\Companion" -Recurse
216-
}
217-
}
176+
# All directory and file operations are now handled by the build-fix.ps1 script
177+
Write-Host "Platform: $platform - Setup completed by build-fix.ps1 script"
218178
219179
- name: Compile Installer
220180
uses: Minionguyjpro/[email protected]

0 commit comments

Comments
 (0)