Skip to content

Sign with the materialized PFX before trying the cert store - #10

Merged
espensev merged 1 commit into
mainfrom
fix/sign-pfx-precedence
Jul 30, 2026
Merged

Sign with the materialized PFX before trying the cert store#10
espensev merged 1 commit into
mainfrom
fix/sign-pfx-precedence

Conversation

@espensev

Copy link
Copy Markdown
Owner

Second v1.6.0 release attempt failed at signing: with THEMETOGGLE_SIGN_CERT_THUMBPRINT now visible to the build step (required by the tagged-release guard), Try-SignFile chose thumbprint/store signing — but CI's release cert exists only as the materialized PFX on disk, so signtool found no store certificate. This flips the precedence to PFX-first; thumbprint/store signing stays as the local path when no PFX is configured. The verify step continues to pin the signer thumbprint.

Validated with tools\validate-release-workflow.ps1. Tag will be re-pushed after merge (no release was published by the failed runs).

🤖 Generated with Claude Code

Try-SignFile preferred thumbprint/store signing whenever
THEMETOGGLE_SIGN_CERT_THUMBPRINT was set. Passing that secret to the CI
build step (required by the tagged-release guard) therefore switched CI
to store lookup, where the release cert does not exist, and signtool
failed with "No certificates were found". The materialized PFX is the
signing credential; the thumbprint is the verify-step identity pin.
Store signing remains the local path when no PFX is configured.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 20:38
@espensev
espensev merged commit 96dbae9 into main Jul 30, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the release signing logic in tools/release/build-and-publish.ps1 so CI prefers signing with the materialized PFX on disk before attempting certificate-store (thumbprint) signing, aligning the script’s behavior with how the GitHub Actions release workflow provides the signing credential.

Changes:

  • Switch signing credential precedence to PFX-first, with thumbprint/store signing as fallback when no PFX is configured.
  • Improve inline documentation explaining the CI vs local signing paths and the role of the pinned thumbprint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +162 to +165
if (-not $password) {
$secure = Read-Host "Enter PFX password" -AsSecureString
$password = Get-PlainTextFromSecureString $secure
}
if (-not $pfxPath) { $pfxPath = $env:PFX_PATH }

if ($pfxPath) {
if (-not (Test-Path $pfxPath)) {
@espensev
espensev deleted the fix/sign-pfx-precedence branch July 30, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants