Skip to content

Commit b8a6fe0

Browse files
Add files via upload
1 parent 3650e70 commit b8a6fe0

File tree

1 file changed

+248
-0
lines changed

1 file changed

+248
-0
lines changed
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
name: Build and Sign Virtual Drivers and Control Panel
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '0 2 * * 0' # Weekly builds
11+
12+
env:
13+
BUILD_CONFIGURATION: Release
14+
BUILD_PLATFORM: x64
15+
16+
jobs:
17+
build-and-sign:
18+
runs-on: windows-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
# Setup build environment
25+
- name: Setup MSBuild
26+
uses: microsoft/setup-msbuild@v1.3
27+
28+
- name: Setup Windows SDK
29+
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11
30+
with:
31+
sdk-version: 22621
32+
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: '6.0.x'
37+
38+
# Build Virtual Display Driver
39+
- name: Build Virtual Display Driver
40+
run: |
41+
if (Test-Path "Virtual Display Driver (HDR)/Virtual Display Driver (HDR).sln") {
42+
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
44+
Write-Output "VDD build completed"
45+
} else {
46+
Write-Output "VDD solution file not found, skipping..."
47+
}
48+
49+
# Build Virtual Audio Driver
50+
- name: Build Virtual Audio Driver
51+
run: |
52+
if (Test-Path "Virtual-Audio-Driver (Latest Stable)/Virtual-Audio-Driver (Latest Stable).sln") {
53+
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
55+
Write-Output "VAD build completed"
56+
} else {
57+
Write-Output "VAD solution file not found, skipping..."
58+
}
59+
continue-on-error: true
60+
61+
# Build Control Panel (handles both same repo and separate repo scenarios)
62+
- name: Checkout Control Panel Repository
63+
if: github.repository != 'VirtualDrivers/Virtual-Driver-Control'
64+
uses: actions/checkout@v4
65+
with:
66+
repository: 'VirtualDrivers/Virtual-Driver-Control'
67+
path: 'control-panel-repo'
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
continue-on-error: true
70+
71+
- name: Build Control Panel
72+
run: |
73+
$controlPanelPath = ""
74+
75+
# Check if control panel is in current repo
76+
if (Test-Path "VDD Control/VDD Control.sln") {
77+
$controlPanelPath = "VDD Control/VDD Control.sln"
78+
$projectPath = "VDD Control/VDD Control/VDD Control.csproj"
79+
Write-Output "Found control panel in current repository"
80+
}
81+
# Check if control panel was checked out separately
82+
elseif (Test-Path "control-panel-repo/VDD Control/VDD Control.sln") {
83+
$controlPanelPath = "control-panel-repo/VDD Control/VDD Control.sln"
84+
$projectPath = "control-panel-repo/VDD Control/VDD Control/VDD Control.csproj"
85+
Write-Output "Found control panel in separate repository"
86+
}
87+
88+
if ($controlPanelPath -ne "") {
89+
Write-Output "Building Control Panel..."
90+
dotnet restore $controlPanelPath
91+
dotnet build $controlPanelPath --configuration $env:BUILD_CONFIGURATION --no-restore
92+
dotnet publish $projectPath --configuration $env:BUILD_CONFIGURATION --output ./control-panel-publish --no-build
93+
Write-Output "Control Panel build completed"
94+
} else {
95+
Write-Output "Control Panel solution file not found, skipping..."
96+
}
97+
continue-on-error: true
98+
99+
# Package all artifacts
100+
- name: Package Artifacts
101+
run: |
102+
Write-Output "Creating artifact packages..."
103+
mkdir -Force artifacts, signpath-artifacts
104+
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/
110+
}
111+
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/
117+
}
118+
119+
# Package Control Panel
120+
if (Test-Path "./control-panel-publish/") {
121+
Write-Output "Packaging Control Panel..."
122+
7z a artifacts/VirtualDriverControlPanel.zip "./control-panel-publish/*"
123+
Copy-Item artifacts/VirtualDriverControlPanel.zip signpath-artifacts/
124+
}
125+
126+
Write-Output "Packaging completed"
127+
128+
# Upload build artifacts (for all builds)
129+
- name: Upload Build Artifacts
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: virtual-drivers-build-${{ github.run_number }}
133+
path: artifacts/
134+
135+
# SignPath Integration (only for main branch and tags)
136+
- name: Submit to SignPath for Signing
137+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
138+
run: |
139+
Write-Output "Submitting artifacts to SignPath for signing..."
140+
$headers = @{
141+
'Authorization' = 'Bearer ${{ secrets.SIGNPATH_API_TOKEN }}'
142+
}
143+
$baseUrl = "https://app.signpath.io/api/v1/${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
144+
145+
# Submit VDD for signing
146+
if (Test-Path "signpath-artifacts/VirtualDisplayDriver.zip") {
147+
Write-Output "Submitting Virtual Display Driver to SignPath..."
148+
try {
149+
$vddResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
150+
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
151+
'SigningPolicySlug' = '${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
152+
'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 }}'
157+
}
158+
Write-Output "✅ VDD submitted to SignPath. Request ID: $($vddResponse.SigningRequestId)"
159+
echo "VDD_SIGNING_REQUEST_ID=$($vddResponse.SigningRequestId)" >> $env:GITHUB_ENV
160+
} catch {
161+
Write-Output "❌ Failed to submit VDD to SignPath: $($_.Exception.Message)"
162+
}
163+
}
164+
165+
# Submit VAD for signing
166+
if (Test-Path "signpath-artifacts/VirtualAudioDriver.zip") {
167+
Write-Output "Submitting Virtual Audio Driver to SignPath..."
168+
try {
169+
$vadResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
170+
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
171+
'SigningPolicySlug' = '${{ secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
172+
'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 }}'
177+
}
178+
Write-Output "✅ VAD submitted to SignPath. Request ID: $($vadResponse.SigningRequestId)"
179+
echo "VAD_SIGNING_REQUEST_ID=$($vadResponse.SigningRequestId)" >> $env:GITHUB_ENV
180+
} catch {
181+
Write-Output "❌ Failed to submit VAD to SignPath: $($_.Exception.Message)"
182+
}
183+
}
184+
185+
# Submit Control Panel for signing
186+
if (Test-Path "signpath-artifacts/VirtualDriverControlPanel.zip") {
187+
Write-Output "Submitting Control Panel to SignPath..."
188+
try {
189+
$controlResponse = Invoke-RestMethod -Uri "$baseUrl/SigningRequests" -Method Post -Headers $headers -Form @{
190+
'ProjectSlug' = '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
191+
'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 }}'
197+
}
198+
Write-Output "✅ Control Panel submitted to SignPath. Request ID: $($controlResponse.SigningRequestId)"
199+
echo "CONTROL_PANEL_SIGNING_REQUEST_ID=$($controlResponse.SigningRequestId)" >> $env:GITHUB_ENV
200+
} catch {
201+
Write-Output "❌ Failed to submit Control Panel to SignPath: $($_.Exception.Message)"
202+
}
203+
}
204+
205+
# Create release on tag push
206+
- name: Create Release
207+
if: startsWith(github.ref, 'refs/tags/')
208+
uses: softprops/action-gh-release@v1
209+
with:
210+
files: artifacts/*
211+
draft: true
212+
body: |
213+
## Virtual Drivers Release ${{ github.ref_name }}
214+
215+
Built from commit: ${{ github.sha }}
216+
217+
### Included Components:
218+
- Virtual Display Driver (VDD)
219+
- Virtual Audio Driver (VAD)
220+
- Virtual Driver Control Panel
221+
222+
### SignPath Signing Status:
223+
- VDD Request ID: ${{ env.VDD_SIGNING_REQUEST_ID }}
224+
- VAD Request ID: ${{ env.VAD_SIGNING_REQUEST_ID }}
225+
- Control Panel Request ID: ${{ env.CONTROL_PANEL_SIGNING_REQUEST_ID }}
226+
227+
**Note:** Artifacts will be code-signed via SignPath before final release.
228+
env:
229+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
230+
231+
# Summary
232+
- name: Build Summary
233+
if: always()
234+
run: |
235+
Write-Output "=== Build Summary ==="
236+
Write-Output "Build Configuration: $env:BUILD_CONFIGURATION"
237+
Write-Output "Platform: $env:BUILD_PLATFORM"
238+
Write-Output "Commit: ${{ github.sha }}"
239+
Write-Output "Branch/Tag: ${{ github.ref }}"
240+
241+
if (Test-Path "artifacts/") {
242+
Write-Output "Built Artifacts:"
243+
Get-ChildItem artifacts/ | ForEach-Object { Write-Output " - $($_.Name)" }
244+
}
245+
246+
if ($env:VDD_SIGNING_REQUEST_ID) { Write-Output "VDD SignPath ID: $env:VDD_SIGNING_REQUEST_ID" }
247+
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" }

0 commit comments

Comments
 (0)