@@ -179,24 +179,43 @@ jobs:
179179 AUTO_UPDATE_URL : ${{ needs.detect-version.outputs.auto_update_url }}
180180 run : bun run package:win
181181
182- - name : Setup SSL.com eSigner CodeSignTool
183- uses : sslcom/esigner-codesign@v1.3.2
182+ - name : Setup Java for CodeSignTool
183+ uses : actions/setup-java@v4
184184 with :
185- command : get_credential_ids
186- username : ${{ secrets.ESIGNER_USERNAME }}
187- password : ${{ secrets.ESIGNER_PASSWORD }}
188- totp_secret : ${{ secrets.ESIGNER_TOTP_SECRET }}
185+ distribution : ' corretto'
186+ java-version : ' 11'
189187
190- - name : Sign Windows EXE with SSL.com eSigner
191- uses : sslcom/esigner-codesign@v1.3.2
192- with :
193- command : sign
194- username : ${{ secrets.ESIGNER_USERNAME }}
195- password : ${{ secrets.ESIGNER_PASSWORD }}
196- credential_id : ${{ secrets.ESIGNER_CREDENTIAL_ID }}
197- totp_secret : ${{ secrets.ESIGNER_TOTP_SECRET }}
198- file_path : ${{ github.workspace }}/packages/device-agent/release
199- override : true
188+ - name : Sign Windows EXE with SSL.com CodeSignTool
189+ shell : powershell
190+ working-directory : packages/device-agent/release
191+ env :
192+ ESIGNER_USERNAME : ${{ secrets.ESIGNER_USERNAME }}
193+ ESIGNER_PASSWORD : ${{ secrets.ESIGNER_PASSWORD }}
194+ ESIGNER_CREDENTIAL_ID : ${{ secrets.ESIGNER_CREDENTIAL_ID }}
195+ ESIGNER_TOTP_SECRET : ${{ secrets.ESIGNER_TOTP_SECRET }}
196+ run : |
197+ # Download and extract CodeSignTool
198+ Invoke-WebRequest -Uri "https://github.com/SSLcom/CodeSignTool/releases/download/v1.3.0/CodeSignTool-v1.3.0-windows.zip" -OutFile "codesigntool.zip"
199+ Expand-Archive -Path "codesigntool.zip" -DestinationPath "codesigntool"
200+
201+ # Find CodeSignTool.bat (may be in root or a subdirectory)
202+ $cstBat = Get-ChildItem -Path "codesigntool" -Recurse -Filter "CodeSignTool.bat" | Select-Object -First 1
203+ if (-not $cstBat) { throw "CodeSignTool.bat not found" }
204+ Write-Host "Found CodeSignTool at: $($cstBat.FullName)"
205+
206+ # Sign each .exe file
207+ Get-ChildItem -Filter "*.exe" | ForEach-Object {
208+ Write-Host "Signing $($_.Name)..."
209+ cmd /c "$($cstBat.FullName)" sign `
210+ -username="$env:ESIGNER_USERNAME" `
211+ -password="$env:ESIGNER_PASSWORD" `
212+ -credential_id="$env:ESIGNER_CREDENTIAL_ID" `
213+ -totp_secret="$env:ESIGNER_TOTP_SECRET" `
214+ -input_file_path="$($_.FullName)" `
215+ -override="true"
216+ if ($LASTEXITCODE -ne 0) { throw "Code signing failed for $($_.Name)" }
217+ Write-Host "Signed $($_.Name) successfully"
218+ }
200219
201220 - name : Recalculate latest.yml hash after signing
202221 shell : bash
0 commit comments