|
86 | 86 | echo "name=${name}" >> "$GITHUB_OUTPUT" |
87 | 87 | echo "version=${version}" >> "$GITHUB_OUTPUT" |
88 | 88 |
|
| 89 | + - name: Sign Windows binary |
| 90 | + if: matrix.client == 'windows' && env.CODE_SIGNING_PFX != '' |
| 91 | + env: |
| 92 | + CODE_SIGNING_PFX: ${{ secrets.CODE_SIGNING_PFX }} |
| 93 | + CODE_SIGNING_PASSWORD: ${{ secrets.CODE_SIGNING_PASSWORD }} |
| 94 | + shell: pwsh |
| 95 | + run: | |
| 96 | + $pfxBytes = [Convert]::FromBase64String($env:CODE_SIGNING_PFX) |
| 97 | + [IO.File]::WriteAllBytes("$pwd\codesign.pfx", $pfxBytes) |
| 98 | + $exe = "${{ matrix.client }}\target\${{ matrix.target }}\release\screenmcp-${{ matrix.client }}.exe" |
| 99 | + $signtool = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits" -Recurse -Filter signtool.exe | Where-Object { $_.FullName -like "*x64*" } | Select-Object -First 1 -ExpandProperty FullName |
| 100 | + & $signtool sign /f codesign.pfx /p $env:CODE_SIGNING_PASSWORD /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $exe |
| 101 | + Remove-Item codesign.pfx |
| 102 | +
|
89 | 103 | - name: Package macOS (.app + .dmg) |
90 | 104 | if: matrix.client == 'mac' |
91 | 105 | shell: bash |
@@ -236,6 +250,26 @@ jobs: |
236 | 250 | working-directory: windows |
237 | 251 | run: ./build-installer.sh "${GITHUB_REF_NAME#v}" |
238 | 252 |
|
| 253 | + - name: Sign Windows installer |
| 254 | + if: env.CODE_SIGNING_PFX != '' |
| 255 | + env: |
| 256 | + CODE_SIGNING_PFX: ${{ secrets.CODE_SIGNING_PFX }} |
| 257 | + CODE_SIGNING_PASSWORD: ${{ secrets.CODE_SIGNING_PASSWORD }} |
| 258 | + run: | |
| 259 | + sudo apt-get install -y osslsigncode |
| 260 | + echo "$CODE_SIGNING_PFX" | base64 -d > codesign.pfx |
| 261 | + version="${GITHUB_REF_NAME#v}" |
| 262 | + file="windows/target/installer/screenmcp-setup-${version}-x86_64.exe" |
| 263 | + osslsigncode sign \ |
| 264 | + -pkcs12 codesign.pfx \ |
| 265 | + -pass "$CODE_SIGNING_PASSWORD" \ |
| 266 | + -ts http://timestamp.digicert.com \ |
| 267 | + -h sha256 \ |
| 268 | + -in "$file" \ |
| 269 | + -out "${file}.signed" |
| 270 | + mv "${file}.signed" "$file" |
| 271 | + rm codesign.pfx |
| 272 | +
|
239 | 273 | - name: Determine installer name |
240 | 274 | id: installer |
241 | 275 | shell: bash |
|
0 commit comments