Skip to content

Move Windows launcher signing from Azure Trusted Signing to SignPath - #70

Open
jmckisson wants to merge 1 commit into
Mudlet:developmentfrom
jmckisson:signpath-code-signing
Open

jmckisson wants to merge 1 commit into
Mudlet:developmentfrom
jmckisson:signpath-code-signing

Conversation

@jmckisson

Copy link
Copy Markdown
Collaborator

Move Windows launcher signing to SignPath

Replaces Azure Trusted Signing (jsign) with SignPath for the Windows MudletInstaller-<game>.exe launchers.

How it works

  1. CI/prepare-signing-win.sh (new) gives each launcher its release name and copies them all into signing-launchers/. The renaming and cleanup used to happen in deploy-win.sh.
  2. The workflow uploads that directory as a single artifact, and signpath/github-action-submit-signing-request@v2 signs it. The artifact configuration's MudletInstaller-*.exe wildcard covers every game, so the whole GameList is one signing request, however long it gets.
  3. CI/deploy-win.sh copies the signed launchers back before publishing. If signing was enabled but a launcher is missing from SignPath's output, it fails with exit code 7. SignPath reports success even when its wildcard misses a file, so without this check an unsigned launcher could end up in a signed release.

When signing runs

Only in the Windows job, and only when all of these hold: SIGNPATH_API_TOKEN is set, the event isn't a pull_request, the actor isn't dependabot, and the repo is Mudlet/bootstrap. Otherwise the launchers are published unsigned, as they are today.

Every signed build uses release-signing, not just tags. A push to development that adds a game creates a release through check-new-games without ever being tagged, so any non-PR build can end up being shipped.

Before merging

  • SignPath project bootstrap exists, with artifact configuration launchers and policies release-signing / test-signing
  • Repo secrets SIGNPATH_API_TOKEN and SIGNPATH_ORGANIZATION_ID are added
  • A manual workflow_dispatch run on this branch produces signed launchers (a PR build won't sign)
  • Windows Explorer → Properties → Digital Signatures on one launcher shows the SignPath Foundation certificate

After merging

  • Remove the AZURE_CREDENTIALS secret, since nothing uses it any more.

The launchers are now staged into one artifact by prepare-signing-win.sh,
signed by SignPath in a single request covering the whole GameList, and
picked back up by deploy-win.sh, which fails if signing was enabled but a
launcher came back unsigned. Drops jsign and the Azure login steps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jmckisson

Copy link
Copy Markdown
Collaborator Author

Builds broken until PR 71 is merged

@vadi2 vadi2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this. The overall shape (stage → one artifact → one signing request → copy back) is right, but a few things will stop it working once #71 lands and signing is actually enabled. None of this has run in CI yet: every job on this PR failed on the Qt breakage before reaching the new steps, and PR builds never sign anyway. Each point below was checked against SignPath's docs, the action's source, or by running the PR's scripts locally with mocked inputs.

1. Wildcard will reject 44 launchers (blocking)

.signpath/artifact-configuration-launchers.xml uses <pe-file path="MudletInstaller-*.exe"> without max-matches. SignPath's artifact configuration syntax says: "Both default to 1, so wildcard expressions without max-matches or min-matches must match exactly one file … Use max-matches="unbounded" for unlimited matches." GameList.txt has 44 entries, so every signed build (tags and new-game pushes) would fail at the signing step and the release job wouldn't run.

Fix: <pe-file path="MudletInstaller-*.exe" max-matches="unbounded">

2. The exit-7 guard in deploy-win.sh can never fire

prepare-signing-win.sh copies the unsigned launchers into signing-launchers/, and the SignPath step extracts into that same directory. The action doesn't clear the target first. In index.js (v2), resolveOrCreateDirectory() only creates the folder if it's missing, then zip.extract(null, targetDirectory) writes over it. So [ -f "${signedLauncher}" ] is always true.

Repro with the PR's two scripts: two games, signing enabled, tag ref, and SignPath "returning" only one signed file. The result is deploy rc=0, with extracted-games containing SIGNED-Achaea and UNSIGNED-Aetolia.

Fix: point output-artifact-directory at a separate, empty directory (e.g. signed-launchers/) and have deploy-win.sh read from there. Ideally, also check the Authenticode signature itself rather than file presence. Related: the comment above that check says a wildcard miss is reported "as a success while quietly handing back fewer files". Per the docs quoted in #1, a count mismatch fails the request instead.

3. A missing token now silently ships unsigned launchers

SIGNPATH_SIGNING_ENABLED includes secrets.SIGNPATH_API_TOKEN != ''. Today, an empty AZURE_CREDENTIALS on Mudlet/bootstrap fails the build: azure/login@v2 throws "Not all values are present". With this change, a missing or rotated token produces green CI and publishes unsigned launchers. That's most likely right after merge if the secrets aren't in place yet.

Suggestion: on non-PR builds of Mudlet/bootstrap, fail the job if the token is empty, instead of folding the check into the enable flag.

4. actions: read may be needed (not confirmed)

The job-level permissions: block sets everything not listed to none. The action's github-token input is documented as "Requires the action:read and content:read permissions". SignPath's "Workflow permissions" section suggests that's only strictly required for private repos without their GitHub App, so this may work as-is on a public repo. I couldn't confirm without a real run. Adding actions: read is cheap insurance. Separately, the action never requests an OIDC token, so id-token: write isn't used, and the comment saying it's what trusted build verification needs doesn't match.

Older issue, not caused by this PR, but relevant to the build.yml comment

The comment at build.yml:20-24 says non-tag new-game releases ship these launchers. As far as I can tell from the code, they currently ship no Windows launcher at all. On non-tag builds none of the deploy/package scripts create extracted-games/. organize-launchers.sh then falls back to matching artifact folders *MINGW64*|*Windows*, and the Windows artifact is MudletInstaller-CLANG64, which doesn't match. I haven't checked this against an actual release's assets.

Looks good

  • The signing on/off logic evaluates correctly (SIGNPATH_SIGNING_ENABLED: false in this PR's own logs).
  • If the upload is skipped, signing is skipped too; a failed or timed-out signing request fails the job.
  • The zip layout and the cygpath -aw hand-off line up with what deploy-win.sh expects.
  • The rebuild, exit-6 guard and rename in prepare-signing-win.sh are correct.

Suggested order: #71 is now merged, so a rebase will get CI past the Qt failures. Fix 1 and 2 here (3 and 4 are cheap to include), then do the workflow_dispatch check from the checklist.


Generated by Claude Code

vadi2 commented Nov 13, 2026

Copy link
Copy Markdown
Member

Update: to get this over the line quicker, we'll fix these up ourselves. We'll open a follow-up PR that keeps your commit as-is and adds the fixes on top, rebased onto development now that #71 is merged. I'll link it here once it's up.


Generated by Claude Code

vadi2 commented Nov 13, 2026

Copy link
Copy Markdown
Member

The follow-up is up as #73. It keeps your commit unchanged and adds the fixes on top.


Generated by Claude Code

vadi2 added a commit that referenced this pull request Nov 14, 2026
* Move Windows launcher signing from Azure Trusted Signing to SignPath

The launchers are now staged into one artifact by prepare-signing-win.sh,
signed by SignPath in a single request covering the whole GameList, and
picked back up by deploy-win.sh, which fails if signing was enabled but a
launcher came back unsigned. Drops jsign and the Azure login steps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix SignPath signing so it can sign the whole GameList and fails loudly

- Allow the launcher wildcard to match every game. SignPath wildcards
  match exactly one file unless max-matches says otherwise, so 44
  launchers would have failed every signing request.
- Extract signed launchers into a fresh signed-launchers/ directory.
  The action extracts over its output directory without clearing it,
  so using the staging directory let the unsigned copies pass the
  missing-launcher check in deploy-win.sh.
- Verify every launcher's Authenticode signature after signing, since
  SignPath passes uncovered files through unsigned.
- Fail builds that should be signed when the SignPath secrets are
  missing, instead of publishing unsigned launchers, as the Azure step
  did before.
- Grant actions: read, which the SignPath action's token needs to read
  job details and download the artifact; drop the unused id-token.
- Pick up Windows launchers from the MudletInstaller-CLANG64 artifact
  in organize-launchers.sh. Releases cut for new games without a tag
  only reach that fallback, which matched MINGW64 or Windows, so they
  shipped no Windows launchers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013FrhV64D6WvcALMeDsT8cb

* Fail if a signed launcher can't replace its unsigned copy; sign only releasable builds

deploy-win.sh didn't check the copy of the signed launcher over the unsigned
one, so a failed copy published the unsigned launcher with CI green.

The comment justifying signing every non-PR build said they can all end up in
a release, but only tags and development can. Sign just those, so master
pushes no longer spend production signing requests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013FrhV64D6WvcALMeDsT8cb

* Stage launchers loudly, keep unsigned ones out of releases, correct comments

- prepare-signing-win.sh exits 7 if a launcher can't be renamed or staged,
  instead of leaving it to deploy-win.sh three steps later.
- The release job only downloads the MudletInstaller-* artifacts, so the
  unsigned-launchers artifact can never be organized into a release.
- Let a re-run of a failed signing job upload its artifact again.
- Comments: SignPath, not the action, uses the token; the verify step
  fails test-signing builds; drop an unverified claim about SignPath
  passing uncovered files through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013FrhV64D6WvcALMeDsT8cb

* Correct two workflow comments on tagging and the signed-copy check

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013FrhV64D6WvcALMeDsT8cb

* Sign manual workflow_dispatch runs on any branch

Restricting signing to tags and development left no way to try a SignPath
change before merging it, which the PR's own checklist relies on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013FrhV64D6WvcALMeDsT8cb

* Sign only releases, enforce launcher version metadata, use the Mudlet SignPath project

* Add GPL license

* Sign under the dedicated bootstrap SignPath project

---------

Co-authored-by: John McKisson <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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