Skip to content

Commit f0bdbfd

Browse files
author
Bud
authored
Added workflow for signing installer too
Sign Installer with seperate policy slug If this isnt allowed, then Mike this is on you. You told me to do the same repo before....
1 parent 94b3510 commit f0bdbfd

1 file changed

Lines changed: 157 additions & 0 deletions

File tree

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Virtual Display Driver Signpath Request
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
strategy:
9+
matrix:
10+
configuration: [Release]
11+
platform: [x64, ARM64]
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup MSBuild
17+
uses: microsoft/setup-msbuild@v1
18+
19+
- name: Check Chocolatey installation
20+
run: choco --version
21+
22+
- name: Install Visual Studio 2022 dependencies
23+
run: |
24+
choco install visualstudio2022-workload-manageddesktop -y
25+
if ($LASTEXITCODE -ne 0) { exit 1 }
26+
27+
choco install visualstudio2022-workload-nativedesktop -y
28+
if ($LASTEXITCODE -ne 0) { exit 1 }
29+
30+
choco install visualstudio2022-workload-vctools -y
31+
if ($LASTEXITCODE -ne 0) { exit 1 }
32+
33+
choco install windowsdriverkit11 -y
34+
if ($LASTEXITCODE -ne 0) { exit 1 }
35+
36+
- name: Build the driver
37+
run: |
38+
msbuild "Virtual Display Driver (HDR)/MTTVDD.sln" /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
39+
40+
- name: List build directory
41+
run: dir "Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD"
42+
43+
- name: Upload built driver
44+
id: upload_artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: Built-Driver-${{ matrix.configuration }}-${{ matrix.platform }}
48+
path: |
49+
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\MttVDD.dll
50+
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\MttVDD.inf
51+
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\mttvdd.cat
52+
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\vdd_settings.xml
53+
54+
- name: Generate release tag
55+
id: generate_tag
56+
run: |
57+
$releaseTag = (Get-Date).ToString('yy.MM.dd')
58+
echo "RELEASE_TAG=$releaseTag" >> $env:GITHUB_ENV
59+
60+
- name: Show generated release tag
61+
run: |
62+
echo "Generated Release Tag: ${{ env.RELEASE_TAG }}"
63+
64+
- name: Verify Built Artifacts
65+
run: dir 'Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD'
66+
67+
68+
- name: Submit signing request to SignPath
69+
id: signpath_request
70+
uses: signpath/github-action-submit-signing-request@v1
71+
with:
72+
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
73+
organization-id: '${{ vars.SIGNPATH_ORG_ID }}'
74+
project-slug: '${{ vars.SIGNPATH_PROJECT_SLUG }}'
75+
signing-policy-slug: '${{ vars.SIGNPATH_POLICY_SLUG }}'
76+
github-artifact-id: '${{ steps.upload_artifact.outputs.artifact-id }}'
77+
wait-for-completion: true
78+
output-artifact-directory: '${{ vars.SIGNPATH_OUTPUT_DIR }}'
79+
parameters: |
80+
Version: ${{ toJSON(matrix.configuration) }}
81+
Release_Tag: "${{ env.RELEASE_TAG }}"
82+
83+
- name: Verify Signed Artifacts
84+
run: dir '${{ vars.SIGNPATH_OUTPUT_DIR }}'
85+
86+
- name: Upload signed artifacts
87+
id: upload_signed_artifacts
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: Signed-Driver-${{ matrix.configuration }}-${{ matrix.platform }}
91+
path: |
92+
${{ vars.SIGNPATH_OUTPUT_DIR }}\MttVDD.dll
93+
${{ vars.SIGNPATH_OUTPUT_DIR }}\MttVDD.inf
94+
${{ vars.SIGNPATH_OUTPUT_DIR }}\mttvdd.cat
95+
${{ vars.SIGNPATH_OUTPUT_DIR }}\vdd_settings.xml
96+
97+
- name: Prepare Setup Repository
98+
run: |
99+
git clone https://${{ secrets.READ_REPO }}@github.com/VirtualDisplay/Virtual-Driver-Installer.git inno-setup
100+
101+
- name: Prepare Setup
102+
run: |
103+
copy "${{ vars.SIGNPATH_OUTPUT_DIR }}\*" inno-setup\input\
104+
$platform = "${{ matrix.platform }}"
105+
(Get-Content "inno-setup\Setup.iss") |
106+
ForEach-Object { $_ -replace '1.0.0', '${{ env.RELEASE_TAG }}' } |
107+
Set-Content "inno-setup\Setup.iss"
108+
109+
if ($platform -eq 'ARM64') {
110+
(Get-Content "inno-setup\Setup.iss") |
111+
ForEach-Object { $_ -replace 'x64compatible', 'arm64' } |
112+
Set-Content "inno-setup\Setup.iss"
113+
114+
(Get-Content "inno-setup\Setup.iss") |
115+
ForEach-Object { $_ -replace '-x64', '-arm64' } |
116+
Set-Content "inno-setup\Setup.iss"
117+
118+
if (Test-Path "inno-setup\input\Companion\VDDSysTray.exe") {Remove-Item "inno-setup\input\Companion\VDDSysTray.exe"}
119+
copy "inno-setup\input\Companion\arm64\VDDSysTray.exe" "inno-setup\input\Companion\"
120+
}
121+
122+
- name: Compile Installer
123+
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
124+
with:
125+
path: inno-setup\Setup.iss
126+
options: /O+
127+
128+
- name: Upload Installer as artifact
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: Installer-${{ matrix.configuration }}-${{ matrix.platform }}
132+
path: inno-setup\output\*.exe
133+
134+
- name: Submit Installer Signing Request to SignPath
135+
id: signpath_installer_request
136+
uses: signpath/github-action-submit-signing-request@v1
137+
with:
138+
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
139+
organization-id: '${{ vars.SIGNPATH_ORG_ID }}'
140+
project-slug: '${{ vars.SIGNPATH_PROJECT_SLUG }}'
141+
signing-policy-slug: '${{ vars.SIGNPATH_POLICY_SLUG_INSTALLER }}'
142+
github-artifact-id: '${{ steps.upload_installer.outputs.artifact-id }}'
143+
wait-for-completion: true
144+
output-artifact-directory: '${{ vars.SIGNPATH_INSTALLER_OUTPUT_DIR }}'
145+
146+
- name: Upload signed installer
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: Signed-Installer-${{ matrix.configuration }}-${{ matrix.platform }}
150+
path: '${{ vars.SIGNPATH_INSTALLER_OUTPUT_DIR }}/*'
151+
152+
celebrate:
153+
runs-on: ubuntu-latest
154+
steps:
155+
- name: Celebrate
156+
run: |
157+
echo "Bud is a god, also hi if you're looking at this!"

0 commit comments

Comments
 (0)