Skip to content

Commit 8e76e9d

Browse files
Update build-and-sign-all.yml
1 parent b8a6fe0 commit 8e76e9d

1 file changed

Lines changed: 112 additions & 33 deletions

File tree

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

Lines changed: 112 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,33 @@ jobs:
3838
# Build Virtual Display Driver
3939
- name: Build Virtual Display Driver
4040
run: |
41-
if (Test-Path "Virtual Display Driver (HDR)/Virtual Display Driver (HDR).sln") {
41+
Write-Output "Searching for VDD solution files..."
42+
$vddSolutions = Get-ChildItem -Path "Virtual Display Driver (HDR)" -Filter "*.sln" -Recurse -ErrorAction SilentlyContinue
43+
if ($vddSolutions) {
44+
$vddSln = $vddSolutions[0].FullName
45+
Write-Output "Found VDD solution: $vddSln"
4246
Write-Output "Building Virtual Display Driver..."
43-
msbuild "Virtual Display Driver (HDR)/Virtual Display Driver (HDR).sln" /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=$env:BUILD_PLATFORM
47+
msbuild $vddSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=$env:BUILD_PLATFORM
4448
Write-Output "VDD build completed"
4549
} else {
46-
Write-Output "VDD solution file not found, skipping..."
50+
Write-Output "No VDD solution files found in Virtual Display Driver (HDR) directory"
51+
Get-ChildItem -Path "Virtual Display Driver (HDR)" -Recurse | Select-Object FullName | ForEach-Object { Write-Output " - $($_.FullName)" }
4752
}
4853
4954
# Build Virtual Audio Driver
5055
- name: Build Virtual Audio Driver
5156
run: |
52-
if (Test-Path "Virtual-Audio-Driver (Latest Stable)/Virtual-Audio-Driver (Latest Stable).sln") {
57+
Write-Output "Searching for VAD solution files..."
58+
$vadSolutions = Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Filter "*.sln" -Recurse -ErrorAction SilentlyContinue
59+
if ($vadSolutions) {
60+
$vadSln = $vadSolutions[0].FullName
61+
Write-Output "Found VAD solution: $vadSln"
5362
Write-Output "Building Virtual Audio Driver..."
54-
msbuild "Virtual-Audio-Driver (Latest Stable)/Virtual-Audio-Driver (Latest Stable).sln" /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=$env:BUILD_PLATFORM
63+
msbuild $vadSln /p:Configuration=$env:BUILD_CONFIGURATION /p:Platform=$env:BUILD_PLATFORM
5564
Write-Output "VAD build completed"
5665
} else {
57-
Write-Output "VAD solution file not found, skipping..."
66+
Write-Output "No VAD solution files found in Virtual-Audio-Driver (Latest Stable) directory"
67+
Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse | Select-Object FullName | ForEach-Object { Write-Output " - $($_.FullName)" }
5868
}
5969
continue-on-error: true
6070

@@ -102,18 +112,58 @@ jobs:
102112
Write-Output "Creating artifact packages..."
103113
mkdir -Force artifacts, signpath-artifacts
104114
105-
# Package VDD
106-
if (Test-Path "Virtual Display Driver (HDR)/$env:BUILD_PLATFORM/$env:BUILD_CONFIGURATION/") {
107-
Write-Output "Packaging Virtual Display Driver..."
108-
7z a artifacts/VirtualDisplayDriver.zip "Virtual Display Driver (HDR)/$env:BUILD_PLATFORM/$env:BUILD_CONFIGURATION/*"
109-
Copy-Item artifacts/VirtualDisplayDriver.zip signpath-artifacts/
115+
# Find and package VDD build outputs
116+
Write-Output "Searching for VDD build outputs..."
117+
$vddOutputs = Get-ChildItem -Path "Virtual Display Driver (HDR)" -Recurse -Directory | Where-Object { $_.Name -eq $env:BUILD_CONFIGURATION -and $_.Parent.Name -eq $env:BUILD_PLATFORM }
118+
if ($vddOutputs) {
119+
foreach ($output in $vddOutputs) {
120+
Write-Output "Found VDD output: $($output.FullName)"
121+
if (Get-ChildItem -Path $output.FullName -Filter "*.sys" -ErrorAction SilentlyContinue) {
122+
Write-Output "Packaging Virtual Display Driver..."
123+
7z a artifacts/VirtualDisplayDriver.zip "$($output.FullName)/*"
124+
Copy-Item artifacts/VirtualDisplayDriver.zip signpath-artifacts/
125+
break
126+
}
127+
}
128+
} else {
129+
Write-Output "No VDD build outputs found, searching for any driver files..."
130+
$vddFiles = Get-ChildItem -Path "Virtual Display Driver (HDR)" -Recurse -Include "*.sys", "*.inf", "*.cat" -ErrorAction SilentlyContinue
131+
if ($vddFiles) {
132+
Write-Output "Found VDD driver files, packaging..."
133+
$tempDir = "temp-vdd"
134+
mkdir $tempDir
135+
$vddFiles | ForEach-Object { Copy-Item $_.FullName $tempDir }
136+
7z a artifacts/VirtualDisplayDriver.zip "$tempDir/*"
137+
Copy-Item artifacts/VirtualDisplayDriver.zip signpath-artifacts/
138+
Remove-Item $tempDir -Recurse -Force
139+
}
110140
}
111141
112-
# Package VAD
113-
if (Test-Path "Virtual-Audio-Driver (Latest Stable)/$env:BUILD_PLATFORM/$env:BUILD_CONFIGURATION/") {
114-
Write-Output "Packaging Virtual Audio Driver..."
115-
7z a artifacts/VirtualAudioDriver.zip "Virtual-Audio-Driver (Latest Stable)/$env:BUILD_PLATFORM/$env:BUILD_CONFIGURATION/*"
116-
Copy-Item artifacts/VirtualAudioDriver.zip signpath-artifacts/
142+
# Find and package VAD build outputs
143+
Write-Output "Searching for VAD build outputs..."
144+
$vadOutputs = Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Directory | Where-Object { $_.Name -eq $env:BUILD_CONFIGURATION -and $_.Parent.Name -eq $env:BUILD_PLATFORM }
145+
if ($vadOutputs) {
146+
foreach ($output in $vadOutputs) {
147+
Write-Output "Found VAD output: $($output.FullName)"
148+
if (Get-ChildItem -Path $output.FullName -Filter "*.sys" -ErrorAction SilentlyContinue) {
149+
Write-Output "Packaging Virtual Audio Driver..."
150+
7z a artifacts/VirtualAudioDriver.zip "$($output.FullName)/*"
151+
Copy-Item artifacts/VirtualAudioDriver.zip signpath-artifacts/
152+
break
153+
}
154+
}
155+
} else {
156+
Write-Output "No VAD build outputs found, searching for any driver files..."
157+
$vadFiles = Get-ChildItem -Path "Virtual-Audio-Driver (Latest Stable)" -Recurse -Include "*.sys", "*.inf", "*.cat" -ErrorAction SilentlyContinue
158+
if ($vadFiles) {
159+
Write-Output "Found VAD driver files, packaging..."
160+
$tempDir = "temp-vad"
161+
mkdir $tempDir
162+
$vadFiles | ForEach-Object { Copy-Item $_.FullName $tempDir }
163+
7z a artifacts/VirtualAudioDriver.zip "$tempDir/*"
164+
Copy-Item artifacts/VirtualAudioDriver.zip signpath-artifacts/
165+
Remove-Item $tempDir -Recurse -Force
166+
}
117167
}
118168
119169
# Package Control Panel
@@ -146,15 +196,20 @@ jobs:
146196
if (Test-Path "signpath-artifacts/VirtualDisplayDriver.zip") {
147197
Write-Output "Submitting Virtual Display Driver to SignPath..."
148198
try {
149-
$vddResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
199+
$formData = @{
150200
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
151201
'SigningPolicySlug' = '${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
152202
'Artifact' = Get-Item "signpath-artifacts/VirtualDisplayDriver.zip"
153-
'Description' = "Virtual Display Driver - Build ${{ github.run_number }} - ${{ github.sha }}"
154-
'Origin.RepositoryUrl' = '${{ github.server_url }}/${{ github.repository }}'
155-
'Origin.Ref' = '${{ github.ref }}'
156-
'Origin.CommitId' = '${{ github.sha }}'
203+
'Description' = "Virtual Display Driver - Build ${{ github.run_number }}"
204+
}
205+
206+
if ('${{ github.ref }}' -eq 'refs/heads/main' -or '${{ github.ref }}' -eq 'refs/heads/master') {
207+
$formData['Origin.RepositoryUrl'] = '${{ github.server_url }}/${{ github.repository }}'
208+
$formData['Origin.Ref'] = '${{ github.ref }}'
209+
$formData['Origin.CommitId'] = '${{ github.sha }}'
157210
}
211+
212+
$vddResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form $formData
158213
Write-Output "✅ VDD submitted to SignPath. Request ID: $($vddResponse.SigningRequestId)"
159214
echo "VDD_SIGNING_REQUEST_ID=$($vddResponse.SigningRequestId)" >> $env:GITHUB_ENV
160215
} catch {
@@ -166,15 +221,20 @@ jobs:
166221
if (Test-Path "signpath-artifacts/VirtualAudioDriver.zip") {
167222
Write-Output "Submitting Virtual Audio Driver to SignPath..."
168223
try {
169-
$vadResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
224+
$formData = @{
170225
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
171226
'SigningPolicySlug' = '${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
172227
'Artifact' = Get-Item "signpath-artifacts/VirtualAudioDriver.zip"
173-
'Description' = "Virtual Audio Driver - Build ${{ github.run_number }} - ${{ github.sha }}"
174-
'Origin.RepositoryUrl' = '${{ github.server_url }}/${{ github.repository }}'
175-
'Origin.Ref' = '${{ github.ref }}'
176-
'Origin.CommitId' = '${{ github.sha }}'
228+
'Description' = "Virtual Audio Driver - Build ${{ github.run_number }}"
177229
}
230+
231+
if ('${{ github.ref }}' -eq 'refs/heads/main' -or '${{ github.ref }}' -eq 'refs/heads/master') {
232+
$formData['Origin.RepositoryUrl'] = '${{ github.server_url }}/${{ github.repository }}'
233+
$formData['Origin.Ref'] = '${{ github.ref }}'
234+
$formData['Origin.CommitId'] = '${{ github.sha }}'
235+
}
236+
237+
$vadResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form $formData
178238
Write-Output "✅ VAD submitted to SignPath. Request ID: $($vadResponse.SigningRequestId)"
179239
echo "VAD_SIGNING_REQUEST_ID=$($vadResponse.SigningRequestId)" >> $env:GITHUB_ENV
180240
} catch {
@@ -186,19 +246,38 @@ jobs:
186246
if (Test-Path "signpath-artifacts/VirtualDriverControlPanel.zip") {
187247
Write-Output "Submitting Control Panel to SignPath..."
188248
try {
189-
$controlResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
249+
Write-Output "API Base URL: $baseUrl"
250+
Write-Output "Project Slug: ${{ secrets.SIGNPATH_PROJECT_SLUG }}"
251+
Write-Output "Signing Policy: ${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}"
252+
253+
$artifact = Get-Item "signpath-artifacts/VirtualDriverControlPanel.zip"
254+
Write-Output "Artifact size: $($artifact.Length) bytes"
255+
256+
$formData = @{
190257
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
191258
'SigningPolicySlug' = '${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
192-
'Artifact' = Get-Item "signpath-artifacts/VirtualDriverControlPanel.zip"
193-
'Description' = "Virtual Driver Control Panel - Build ${{ github.run_number }} - ${{ github.sha }}"
194-
'Origin.RepositoryUrl' = '${{ github.server_url }}/${{ github.repository }}'
195-
'Origin.Ref' = '${{ github.ref }}'
196-
'Origin.CommitId' = '${{ github.sha }}'
259+
'Artifact' = $artifact
260+
'Description' = "Virtual Driver Control Panel - Build ${{ github.run_number }}"
261+
}
262+
263+
# Add origin verification if this is from main branch
264+
if ('${{ github.ref }}' -eq 'refs/heads/main' -or '${{ github.ref }}' -eq 'refs/heads/master') {
265+
$formData['Origin.RepositoryUrl'] = '${{ github.server_url }}/${{ github.repository }}'
266+
$formData['Origin.Ref'] = '${{ github.ref }}'
267+
$formData['Origin.CommitId'] = '${{ github.sha }}'
197268
}
269+
270+
$controlResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form $formData
198271
Write-Output "✅ Control Panel submitted to SignPath. Request ID: $($controlResponse.SigningRequestId)"
199272
echo "CONTROL_PANEL_SIGNING_REQUEST_ID=$($controlResponse.SigningRequestId)" >> $env:GITHUB_ENV
200273
} catch {
201274
Write-Output "❌ Failed to submit Control Panel to SignPath: $($_.Exception.Message)"
275+
Write-Output "❌ Response: $($_.Exception.Response)"
276+
if ($_.Exception.Response) {
277+
$reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
278+
$responseBody = $reader.ReadToEnd()
279+
Write-Output "❌ Response body: $responseBody"
280+
}
202281
}
203282
}
204283
@@ -245,4 +324,4 @@ jobs:
245324
246325
if ($env:VDD_SIGNING_REQUEST_ID) { Write-Output "VDD SignPath ID: $env:VDD_SIGNING_REQUEST_ID" }
247326
if ($env:VAD_SIGNING_REQUEST_ID) { Write-Output "VAD SignPath ID: $env:VAD_SIGNING_REQUEST_ID" }
248-
if ($env:CONTROL_PANEL_SIGNING_REQUEST_ID) { Write-Output "Control Panel SignPath ID: $env:CONTROL_PANEL_SIGNING_REQUEST_ID" }
327+
if ($env:CONTROL_PANEL_SIGNING_REQUEST_ID) { Write-Output "Control Panel SignPath ID: $env:CONTROL_PANEL_SIGNING_REQUEST_ID" }

0 commit comments

Comments
 (0)