add(ci): signing bin before release#2202
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Windows code-signing step to the release workflow (via Certum SimplySign) so Windows binaries can be signed before drafting a GitHub Release.
Changes:
- Introduces a
sign-windowsjob that downloads Windows artifacts, installs/configures SimplySign, signs.exe/.dll, and uploads “signed” artifacts. - Updates the
releasejob to prefer signed artifacts when present and to include signing status in release notes. - Adds helper scripts for SimplySign installation, registry configuration, and TOTP-based authentication.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| .github/workflows/release.yml | Adds signing job, artifact switching logic, and release notes generation. |
| .github/scripts/install-simplysign.sh | Installs SimplySign Desktop MSI on Windows runner. |
| .github/scripts/configure-simplysign-registry.ps1 | Preconfigures HKCU registry settings to make SimplySign login dialog automation-friendly. |
| .github/scripts/Connect-SimplySign-Enhanced.ps1 | Generates TOTP and automates SimplySign login via window focus + SendKeys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…into dev-signcode
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| permissions: | ||
| contents: write | ||
|
|
||
|
|
||
| # SimplySign signing configuration | ||
| CERTUM_OTP_URI: ${{ secrets.CERTUM_OTP_URI }} | ||
| CERTUM_USERNAME: ${{ secrets.CERTUM_USERNAME }} | ||
| CERTUM_EXE_PATH: ${{ secrets.CERTUM_EXE_PATH }} |
| sign-windows: | ||
| name: Sign Windows Artifacts with SimplySign | ||
| runs-on: windows-latest | ||
| continue-on-error: true |
| # Continue regardless of signing result (success, failure, skipped, or cancelled) | ||
| if: ${{ always() && (needs.sign-windows.result == 'success' || needs.sign-windows.result == 'failure' || needs.sign-windows.result == 'cancelled' || needs.sign-windows.result == 'skipped') }} | ||
| steps: | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Check signing result | ||
| id: check_signing | ||
| run: | | ||
| echo "Signing job result: ${{ needs.sign-windows.result }}" | ||
| if [ "${{ needs.sign-windows.result }}" = "success" ]; then | ||
| echo "status=signed" >> $GITHUB_OUTPUT | ||
| echo "Windows artifacts were signed successfully" | ||
| else | ||
| echo "status=unsigned" >> $GITHUB_OUTPUT | ||
| echo "Warning: Windows signing was skipped or failed, continuing without signatures" | ||
| fi | ||
|
|
||
| - name: Download signed artifacts (if available) | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: signed-windows-artifacts | ||
| path: signed_release_assets | ||
| continue-on-error: true | ||
|
|
| foreach ($file in $filesToSign) { | ||
| Write-Host "Signing: $($file.FullName)" | ||
| try { | ||
| # Using signtool with the certificate from SimplySign virtual smart card | ||
| $timestampServer = "http://timestamp.digicert.com" | ||
| & signtool sign /fd SHA256 /tr $timestampServer /td SHA256 /a "$($file.FullName)" | ||
| Write-Host " OK: Signed successfully" | ||
| } catch { | ||
| Write-Host " WARNING: Failed to sign file - $($_.Exception.Message)" | ||
| } | ||
| } | ||
|
|
||
| Write-Host "=== SIGNING COMPLETE ===" |
| Write-Host "Signing: $($file.FullName)" | ||
| try { | ||
| # Using signtool with the certificate from SimplySign virtual smart card | ||
| $timestampServer = "http://timestamp.digicert.com" |
| CERTUM_INSTALLER="SimplySignDesktop.msi" | ||
| echo "Downloading SimplySign Desktop MSI..." | ||
|
|
||
| if curl -L "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.2.67/SimplySignDesktop-9.3.2.67-64-bit-en.msi" -o "$CERTUM_INSTALLER" --fail --max-time 60; then |
|
|
||
| $Digits = if ($q['digits']) { [int]$q['digits'] } else { 6 } | ||
| $Period = if ($q['period']) { [int]$q['period'] } else { 30 } | ||
| $Algorithm = if ($q['algorithm']) { $q['algorithm'].ToUpper() } else { 'SHA256' } |
|
@copilot apply changes based on the comments in this thread |
添加了Certum EV Cloud Signing代码签名步骤