47
47
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
48
48
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
49
49
50
+ - name : Get rcedit from chocolatey
51
+ run : |
52
+ choco install rcedit -y
53
+ shell : " pwsh"
54
+
50
55
- name : Move files
51
56
run : |
52
57
mkdir publish\debug
70
75
move msvc\${{ env.buildRelease }}\filesystem_stdio.pdb publish\debug\filesystem_stdio.pdb
71
76
move msvc\${{ env.buildRelease }}\director.pdb publish\debug\director.pdb
72
77
78
+ # TODO: Set version to exe dynamicly: 0.0.0.0 to normal version such as at linux
79
+ - name : Edit resources at windows binaries
80
+ run : |
81
+ rcedit ${{ github.workspace }}\publish\bin\win32\hlds.exe --set-version-string ProductName "ReHLDS" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "The Half-Life Dedicated Server, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam"
82
+ rcedit ${{ github.workspace }}\publish\bin\win32\hltv.exe --set-version-string ProductName "ReHLTV" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "The Half-Life TV, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam"
83
+ rcedit ${{ github.workspace }}\publish\tests\swds.dll --set-version-string ProductName "swds.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A dll used by Steamworks Dedicated Servers, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
84
+ rcedit ${{ github.workspace }}\publish\bin\win32\swds.dll --set-version-string ProductName "swds.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A ddll used by Steamworks Dedicated Servers, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
85
+ rcedit ${{ github.workspace }}\publish\bin\win32\core.dll --set-version-string ProductName "core.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription " A dll, it is a core of game engine, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
86
+ rcedit ${{ github.workspace }}\publish\bin\win32\proxy.dll --set-version-string ProductName "proxy.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A dll for proxying network connections, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
87
+ rcedit ${{ github.workspace }}\publish\bin\win32\demoplayer.dll --set-version-string ProductName "demoplayer.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A dll for demoplayer functionality, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
88
+ rcedit ${{ github.workspace }}\publish\bin\win32\filesystem_stdio.dll --set-version-string ProductName "filesystem_stdio.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A dll that manages file input/output operations, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
89
+ rcedit ${{ github.workspace }}\publish\bin\win32\valve\dlls\director.dll --set-version-string ProductName "director.dll" --set-file-version "0.0.0.0" --set-product-version "0.0.0.0" --set-version-string FileDescription "A dll used for Director functionality in Half-Life 1, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon rehlds/dedicated/msvc/icon.ico
90
+ shell : " pwsh"
91
+
92
+ - name : Import PFX and sign
93
+ env :
94
+ KEY_PFX_PASS : ${{ secrets.KEY_PFX_PASS}}
95
+ run : |
96
+ $pfxBase64 = "${{ secrets.KEY_PFX_B64 }}"
97
+ [IO.File]::WriteAllBytes("${{ github.workspace }}\signing-cert.pfx", [Convert]::FromBase64String($pfxBase64))
98
+ certutil -f -p "${{ secrets.KEY_PFX_PASS }}" -importPFX "${{ github.workspace }}\signing-cert.pfx"
99
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\hlds.exe
100
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "reHLTV" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\hltv.exe
101
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - swds.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\tests\swds.dll
102
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - swds.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\swds.dll
103
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - core.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\core.dll
104
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - proxy.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\proxy.dll
105
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - demoplayer.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\demoplayer.dll
106
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - filesystem_stdio.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\filesystem_stdio.dll
107
+ & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "ReHLDS - director.dll" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha512 /fd sha512 /v ${{ github.workspace }}\publish\bin\win32\valve\dlls\director.dll
108
+ Remove-Item -Recurse -Force "${{ github.workspace }}\signing-cert.pfx"
109
+ shell : " pwsh"
110
+
73
111
- name : Deploy artifacts
74
112
uses : actions/upload-artifact@v4
75
113
with :
78
116
79
117
testdemos :
80
118
name : ' Test demos'
81
- runs-on : ubuntu-latest
119
+ runs-on : ubuntu-24.04
82
120
container : rehldsorg/testdemos:latest
83
121
needs : [windows]
84
122
defaults :
@@ -116,7 +154,7 @@ jobs:
116
154
117
155
linux :
118
156
name : ' Linux'
119
- runs-on : ubuntu-latest
157
+ runs-on : ubuntu-24.04
120
158
container : debian:11-slim
121
159
122
160
steps :
@@ -136,6 +174,48 @@ jobs:
136
174
git cmake rsync \
137
175
g++ gcc
138
176
177
+ - name : GPG Import
178
+ run : |
179
+ echo "${{ secrets.PUB_ASC }}" > "${{ secrets.PUB_ASC_FILE }}"
180
+ echo "${{ secrets.KEY_ASC }}" > "${{ secrets.KEY_ASC_FILE }}"
181
+
182
+ # Import the public key
183
+ gpg --batch --yes --import "${{ secrets.PUB_ASC_FILE }}"
184
+ if [[ $? -ne 0 ]]; then
185
+ echo "Error: Failed to import the public key"
186
+ exit 1
187
+ fi
188
+
189
+ # Import the private key
190
+ gpg --batch --yes --import "${{ secrets.KEY_ASC_FILE }}"
191
+ if [[ $? -ne 0 ]]; then
192
+ echo "Error: Failed to import the private key"
193
+ exit 2
194
+ fi
195
+
196
+ # Extract the fingerprint of the imported public key
197
+ GPG_LINUX_FINGERPRINT=$(gpg --list-keys --with-colons | grep '^fpr' | head -n 1 | cut -d: -f10)
198
+
199
+ # Check if the fingerprint was extracted
200
+ if [[ -z "$GPG_LINUX_FINGERPRINT" ]]; then
201
+ echo "Error: Failed to extract the fingerprint of the key"
202
+ exit 3
203
+ fi
204
+
205
+ # Set the trust level for the key
206
+ echo "$GPG_LINUX_FINGERPRINT:6:" | gpg --batch --import-ownertrust
207
+ if [ $? -ne 0 ]; then
208
+ echo "Error: Failed to set trust for the key $GPG_LINUX_FINGERPRINT"
209
+ exit 4
210
+ fi
211
+
212
+ echo "Key $GPG_LINUX_FINGERPRINT successfully imported and trusted"
213
+ gpg --list-keys
214
+
215
+ #export for global use
216
+ echo "GPG_LINUX_FINGERPRINT=$GPG_LINUX_FINGERPRINT" >> $GITHUB_ENV
217
+ shell : bash
218
+
139
219
- name : Build and Run unittests
140
220
run : |
141
221
rm -rf build && cmake -DCMAKE_BUILD_TYPE=Unittests -B build && cmake --build build -j8
@@ -213,7 +293,7 @@ jobs:
213
293
214
294
publish :
215
295
name : ' Publish'
216
- runs-on : ubuntu-latest
296
+ runs-on : ubuntu-24.04
217
297
needs : [windows, testdemos, linux]
218
298
219
299
steps :
@@ -241,15 +321,42 @@ jobs:
241
321
fi
242
322
rm -f appversion.h
243
323
244
- - name : Packaging bin/dbg
324
+ - name : Final signing and Packaging bin/dbg
245
325
id : packaging-job
246
326
if : |
247
327
github.event_name == 'release' &&
248
328
github.event.action == 'published' &&
249
329
startsWith(github.ref, 'refs/tags/')
250
330
run : |
331
+
332
+ # new runner, niw signs
333
+ echo "${{ secrets.PUB_ASC }}" > "${{ secrets.PUB_ASC_FILE }}"
334
+ echo "${{ secrets.KEY_ASC }}" > "${{ secrets.KEY_ASC_FILE }}"
335
+ gpg --batch --yes --import "${{ secrets.PUB_ASC_FILE }}"
336
+ gpg --batch --yes --import "${{ secrets.KEY_ASC_FILE }}"
337
+ GPG_LINUX_FINGERPRINT=$(gpg --list-keys --with-colons | grep '^fpr' | head -n 1 | cut -d: -f10)
338
+ echo "$GPG_LINUX_FINGERPRINT:6:" | gpg --batch --import-ownertrust
339
+ echo "GPG_LINUX_FINGERPRINT=$GPG_LINUX_FINGERPRINT" >> $GITHUB_ENV
340
+
341
+ sign_file() {
342
+ local file=$1
343
+ gpg --batch --yes --detach-sign --armor -u "$GPG_LINUX_FINGERPRINT" "$file"
344
+ if [ $? -ne 0 ]; then
345
+ echo "Error: Failed to sign $file"
346
+ exit 2
347
+ fi
348
+ echo "$file signed successfully."
349
+ }
350
+
351
+ # Pack and sign final archive
251
352
7z a -tzip rehlds-bin-${{ env.APP_VERSION }}.zip bin/ hlsdk/
353
+ sign_file "rehlds-bin-${{ env.APP_VERSION }}.zip"
354
+
355
+ # Pack and sign final archive
252
356
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -aoa rehlds-dbg-${{ env.APP_VERSION }}.7z debug/
357
+ sign_file "rehlds-dbg-${{ env.APP_VERSION }}.7z"
358
+
359
+ shell : bash
253
360
254
361
- name : Publish artifacts
255
362
uses : softprops/action-gh-release@v2
@@ -261,5 +368,6 @@ jobs:
261
368
files : |
262
369
*.zip
263
370
*.7z
371
+ *.asc
264
372
env :
265
373
GITHUB_TOKEN : ${{ secrets.API_TOKEN }}
0 commit comments