Skip to content

build(release): sign with a stable self-signed certificate - #2

Merged
fabiomsnunes merged 2 commits into
feat/auto-updatefrom
feat/stable-signing
Nov 17, 2026
Merged

fabiomsnunes merged 2 commits into
feat/auto-updatefrom
feat/stable-signing

Conversation

@fabiomsnunes

Copy link
Copy Markdown
Owner

Releases were ad-hoc signed, so the designated requirement was the binary's own hash and every update looked like a new app to macOS: users had to grant Accessibility again.

  • scripts/sign-app.sh re-signs the exported app (nested code first) with the self-signed WindowLatch Release certificate and fails if the designated requirement is not pinned to its fingerprint (6677765C…2A27).
  • release.yml imports the certificate from MACOS_SIGNING_P12_BASE64 / MACOS_SIGNING_P12_PASSWORD into a throwaway keychain.
  • README: verify steps and FAQ updated; notes that 1.0.2 → next asks for the permission one last time.

Gatekeeper still blocks the first launch: that needs a Developer ID and notarisation.

Tested locally: Release archive signed by the script, codesign --verify --deep --strict passes, requirement is certificate leaf = H"6677…".

Ad-hoc signing pins the designated requirement to the binary's hash, so
macOS treats every release as a new app and users have to grant
Accessibility again after each update. Re-sign the exported app with the
'WindowLatch Release' certificate, whose fingerprint scripts/sign-app.sh
pins and checks, so the requirement and the grant survive updates.
CI installs the latest SwiftFormat, whose new rule has failed the lint on
main since 2026-11-10. Formatting only, no behaviour change.
@wplus-code-review

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Worth a look (not blocking)

  • scripts/sign-app.sh: --options runtime turns on the hardened runtime. The earlier ad-hoc builds didn't have it, and the PR description doesn't mention it. No code in the app looks affected (Accessibility API only, no Apple Events, no dlopen), but it is a change in runtime behaviour worth a quick smoke test of the signed build.
  • scripts/sign-app.sh: the loop that signs nested code only matches *.framework, *.xpc, *.app and *.dylib. A bare helper executable added later (for example under Contents/Helpers) wouldn't be re-signed on its own. The app has no such helper today.
  • .github/workflows/release.yml: the throwaway keychain is never deleted. This is harmless on ephemeral GitHub-hosted runners but would leave it behind on a self-hosted runner.
What was checked
  • The PR is open, not a draft, and not trivial.
  • There are no CLAUDE.md files in the repo, so the compliance audit had nothing to check against.
  • Workflow wiring is correct: the export path build/export/WindowLatch.app matches what the sign step and the dmg step use, and SIGNING_KEYCHAIN is passed through GITHUB_ENV.
  • Secrets go in through env:, not straight into the script text. The .p12 is deleted after import, the keychain password is random, and the workflow only runs on tag pushes, so fork PRs can't reach the secrets.
  • codesign finds the identity because it uses --keychain and the SHA-1. The partition list is set, so it won't hang on a UI prompt.
  • sign-app.sh itself:
    • quoting is correct;
    • the :? guards stop the script when a value is missing;
    • find -depth signs nested code before the bundles that contain it;
    • matching on the lowercase fingerprint fits what codesign -d -r- prints.
  • Entitlements are kept: the repo has no .entitlements files and the app sandbox is off.
  • The CycleEngine.swift else { if … } → else if flattening behaves exactly as before. The other Swift changes only wrap one-line if bodies.

WPlus Code Review · commit 6ebab91 · 92 s

@fabiomsnunes
fabiomsnunes merged commit 5a33dcd into feat/auto-update Nov 17, 2026
2 checks passed
@fabiomsnunes
fabiomsnunes deleted the feat/stable-signing branch November 17, 2026 17:25
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