Skip to content

Fix Windows Tauri signing order#584

Merged
AnthonyRonning merged 1 commit into
masterfrom
fix/windows-tauri-signing-order
Jun 25, 2026
Merged

Fix Windows Tauri signing order#584
AnthonyRonning merged 1 commit into
masterfrom
fix/windows-tauri-signing-order

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move Windows Authenticode signing into Tauri's bundle.windows.signCommand so Tauri signs after patching bundle metadata
  • remove the separate pre-bundle app signing and post-bundle installer signing action steps
  • add a pinned ArtifactSigning PowerShell wrapper that uses the Azure CLI credential from azure/login
  • verify the final NSIS installer signature before updater signing/checksums

Why

Tauri mutates target/release/maple.exe during bundling to add bundle-type metadata, then signs at that point if a Windows signCommand is configured. Signing the executable before tauri bundle is unsafe because Tauri still needs to patch it, and can also leave the file locked on Windows.

Validation

  • bash -n scripts/ci/_common.sh scripts/ci/desktop-windows-release.sh
  • generated Windows Tauri release JSON validates with jq
  • nix flake check

Note: PR CI cannot exercise the live Azure signing secrets. The protected master Windows signing workflow is the final validation point for the real signed build.


Open in Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows desktop release signing in CI by switching to a PowerShell-based signing tool installation and using dedicated signing configuration values from CI secrets.
    • Tightened Windows packaging validation: the build now stops early if the app executable is missing, and Authenticode verification is streamlined to focus on the NSIS installer executable during the appropriate release stages.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b761c4b3-da1f-444b-994f-7c921ddb3f58

📥 Commits

Reviewing files that changed from the base of the PR and between dd0a7f9 and 382bbef.

📒 Files selected for processing (6)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
  • scripts/ci/_common.sh
  • scripts/ci/desktop-windows-release.sh
  • scripts/ci/install-windows-artifact-signing.ps1
  • scripts/ci/windows-artifact-sign.ps1
🚧 Files skipped from review as they are similar to previous changes (6)
  • scripts/ci/windows-artifact-sign.ps1
  • scripts/ci/install-windows-artifact-signing.ps1
  • scripts/ci/_common.sh
  • .github/workflows/desktop-build.yml
  • scripts/ci/desktop-windows-release.sh
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The PR replaces Azure action-based Windows signing with a PowerShell ArtifactSigning flow, updates Windows workflow variables and install steps, adds a Tauri signing command, and shifts bundle/finalize checks to focus on the NSIS setup executable.

Changes

Windows artifact signing pipeline

Layer / File(s) Summary
Tauri signCommand and helper
scripts/ci/_common.sh, scripts/ci/windows-artifact-sign.ps1
windows_tauri_release_bundle_config emits a bundle.windows.signCommand that runs the new PowerShell helper, and the helper validates the file and signing inputs before calling Invoke-ArtifactSigning from ArtifactSigning 0.1.8.
ArtifactSigning install helper
scripts/ci/install-windows-artifact-signing.ps1
The CI install script downloads ArtifactSigning, verifies its hash, expands the module, validates the exported command, and writes module-path environment values for later steps.
Workflow signing wiring
.github/workflows/desktop-build.yml, .github/workflows/release.yml
Both Windows workflows add the signing endpoint, account name, and certificate profile secrets, install ArtifactSigning 0.1.8, and remove the Azure artifact-signing-action steps for app and installer signing.
Bundle and finalize checks
scripts/ci/desktop-windows-release.sh
run_bundle_phase now checks for the app executable, verifies and hashes the NSIS setup executable, and runs verify_frontend_dist_unchanged; run_finalize_phase verifies only the setup executable.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • OpenSecretCloud/Maple#582: Also replaces Azure action-based Windows signing with the PowerShell helper and bundle/signCommand wiring.

Poem

A rabbit hopped through CI with glee,
and signed each artifact carefully.
The setup exe shone bright and true,
while hashes and checks did their due.
🐇

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adjusting Windows Tauri signing order.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-tauri-signing-order

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: 382bbef
Status: ✅  Deploy successful!
Preview URL: https://0ba44a5e.maple-ca8.pages.dev
Branch Preview URL: https://fix-windows-tauri-signing-or.maple-ca8.pages.dev

View logs

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/desktop-windows-release.sh`:
- Around line 89-103: Keep the post-bundling verification for the patched app
executable in addition to the NSIS setup. In run_finalize_phase and the related
bundling flow, locate the app_exe artifact that Tauri mutates and add an
Authenticode signature check for it alongside
verify_windows_authenticode_signatures used for setup_exe, so both the installer
and installed executable are validated after signCommand runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27154b3d-7f49-4c30-9a26-8f5b8f76b6aa

📥 Commits

Reviewing files that changed from the base of the PR and between 9400b54 and 2a4c6a7.

📒 Files selected for processing (5)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
  • scripts/ci/_common.sh
  • scripts/ci/desktop-windows-release.sh
  • scripts/ci/windows-artifact-sign.ps1

Comment on lines +89 to +103
verify_windows_authenticode_signatures "${setup_exe}"
print_file_hashes "${setup_exe}"
verify_frontend_dist_unchanged
}

run_finalize_phase() {
local app_exe setup_exe repro_dir
local setup_exe repro_dir
local windows_runtime_dlls=()

print_source_provenance
configure_reproducible_build_metadata
configure_tauri_updater_signing_key

app_exe="$(windows_release_app_exe)"
setup_exe="$(windows_release_setup_exe_required)"
verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
verify_windows_authenticode_signatures "${setup_exe}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Keep verifying the patched app executable after bundling.

Line 89 and Line 103 now verify only the NSIS setup. Since the app exe is the artifact Tauri mutates and signCommand is expected to sign, verify ${app_exe} after bundling as well; otherwise a signed installer can ship an unsigned or wrong-subject installed executable.

Proposed fix
   setup_exe="$(windows_release_setup_exe_required)"
-  verify_windows_authenticode_signatures "${setup_exe}"
+  verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
   print_file_hashes "${setup_exe}"
   verify_frontend_dist_unchanged
 }
 
 run_finalize_phase() {
-  local setup_exe repro_dir
+  local app_exe setup_exe repro_dir
   local windows_runtime_dlls=()
 
   print_source_provenance
   configure_reproducible_build_metadata
   configure_tauri_updater_signing_key
 
+  app_exe="$(windows_release_app_exe)"
   setup_exe="$(windows_release_setup_exe_required)"
-  verify_windows_authenticode_signatures "${setup_exe}"
+  verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
verify_windows_authenticode_signatures "${setup_exe}"
print_file_hashes "${setup_exe}"
verify_frontend_dist_unchanged
}
run_finalize_phase() {
local app_exe setup_exe repro_dir
local setup_exe repro_dir
local windows_runtime_dlls=()
print_source_provenance
configure_reproducible_build_metadata
configure_tauri_updater_signing_key
app_exe="$(windows_release_app_exe)"
setup_exe="$(windows_release_setup_exe_required)"
verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
verify_windows_authenticode_signatures "${setup_exe}"
verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
print_file_hashes "${setup_exe}"
verify_frontend_dist_unchanged
}
run_finalize_phase() {
local app_exe setup_exe repro_dir
local windows_runtime_dlls=()
print_source_provenance
configure_reproducible_build_metadata
configure_tauri_updater_signing_key
app_exe="$(windows_release_app_exe)"
setup_exe="$(windows_release_setup_exe_required)"
verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/desktop-windows-release.sh` around lines 89 - 103, Keep the
post-bundling verification for the patched app executable in addition to the
NSIS setup. In run_finalize_phase and the related bundling flow, locate the
app_exe artifact that Tauri mutates and add an Authenticode signature check for
it alongside verify_windows_authenticode_signatures used for setup_exe, so both
the installer and installed executable are validated after signCommand runs.

@AnthonyRonning
AnthonyRonning force-pushed the fix/windows-tauri-signing-order branch from 2a4c6a7 to dd0a7f9 Compare June 25, 2026 23:12
coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Open in Devin Review

Comment on lines 98 to +107
run_finalize_phase() {
local app_exe setup_exe repro_dir
local setup_exe repro_dir
local windows_runtime_dlls=()

print_source_provenance
configure_reproducible_build_metadata
configure_tauri_updater_signing_key

app_exe="$(windows_release_app_exe)"
setup_exe="$(windows_release_setup_exe_required)"
verify_windows_authenticode_signatures "${app_exe}" "${setup_exe}"
verify_windows_authenticode_signatures "${setup_exe}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Authenticode verification scope narrowed from exe+installer to installer-only

The finalize phase previously verified Authenticode signatures on both maple.exe and the NSIS installer (scripts/ci/desktop-windows-release.sh:107). Now it only verifies the installer. This is intentional because Tauri restores target/release/maple.exe to its original unsigned/unpatched bytes after bundling. The signed exe only exists inside the NSIS installer payload. This is a correct behavioral change, but reviewers should confirm that Tauri's signCommand in Tauri 2.x does indeed restore the original exe and sign the NSIS installer itself (not just the embedded exe). If Tauri doesn't sign the NSIS installer via signCommand, the verify_windows_authenticode_signatures call in the bundle phase at scripts/ci/desktop-windows-release.sh:93 would fail, which provides a safety net.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +43 to +61
$params = @{
Endpoint = $env:MAPLE_WINDOWS_ARTIFACT_SIGNING_ENDPOINT
CodeSigningAccountName = $env:MAPLE_WINDOWS_ARTIFACT_SIGNING_ACCOUNT_NAME
CertificateProfileName = $env:MAPLE_WINDOWS_ARTIFACT_SIGNING_CERTIFICATE_PROFILE_NAME
Files = $File
FileDigest = "SHA256"
TimestampRfc3161 = "http://timestamp.acs.microsoft.com"
TimestampDigest = "SHA256"
ExcludeEnvironmentCredential = $true
ExcludeWorkloadIdentityCredential = $true
ExcludeManagedIdentityCredential = $true
ExcludeSharedTokenCacheCredential = $true
ExcludeVisualStudioCredential = $true
ExcludeVisualStudioCodeCredential = $true
ExcludeAzureCliCredential = $false
ExcludeAzurePowerShellCredential = $true
ExcludeAzureDeveloperCliCredential = $true
ExcludeInteractiveBrowserCredential = $true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Module parameter names mapped from GitHub Action input names to PowerShell cmdlet parameters

The old GitHub Action used kebab-case input names (e.g., signing-account-name) while the new script uses PascalCase PowerShell cmdlet parameters (e.g., CodeSigningAccountName at scripts/ci/windows-artifact-sign.ps1:45). Note the semantic difference: the action input was signing-account-name but the cmdlet parameter is CodeSigningAccountName (not SigningAccountName). This mapping was presumably derived from the ArtifactSigning module's actual cmdlet signature. If the parameter name is incorrect, Invoke-ArtifactSigning would fail at runtime since $ErrorActionPreference = 'Stop' is set, so any mismatch would be caught immediately in CI. Still worth confirming the parameter names match version 0.1.8 of the module.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@AnthonyRonning
AnthonyRonning force-pushed the fix/windows-tauri-signing-order branch from dd0a7f9 to 382bbef Compare June 25, 2026 23:30
@AnthonyRonning
AnthonyRonning merged commit 5e6a05f into master Jun 25, 2026
18 checks passed
@AnthonyRonning
AnthonyRonning deleted the fix/windows-tauri-signing-order branch June 25, 2026 23:45
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.

1 participant