Address issue #238: Code-Sign the macdown CLI Binary#239
Merged
Conversation
Add explicit code signing for the macdown CLI binary in the release workflow to ensure it passes Homebrew Cask's signature verification. Changes: - Add "Sign CLI binary explicitly" step after build with: - Hardened runtime (--options runtime) - Secure timestamp (--timestamp) - Developer ID Application certificate - Add CLI binary verification in "Verify code signature" step: - Signature validation - Developer ID check - Hardened runtime verification - Add CLI binary verification in DMG verification step The CodeSignOnCopy attribute in Xcode only performs basic signing without hardened runtime or timestamp, which is insufficient for Homebrew Cask/Gatekeeper requirements. Related to #238
Address code review feedback: 1. Fix CLI binary path: Changed from Contents/MacOS/bin/macdown to Contents/SharedSupport/bin/macdown (dstSubfolderSpec=12 in Xcode maps to SharedSupport, not MacOS) 2. Add app bundle re-signing: After re-signing the CLI binary with hardened runtime, we must re-sign the app bundle to update the code signature seal. This ensures notarization doesn't fail due to a broken seal. Related to #238
Contributor
Code Coverage ReportCurrent Coverage: 51.28% Coverage Details (Summary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add explicit code signing for the
macdownCLI binary in the release workflow to ensure it passes Homebrew Cask's signature verification.Changes
New "Sign CLI binary explicitly" step (after build, before verification):
Contents/SharedSupport/bin/macdown--force --options runtime --timestampflagsEnhanced "Verify code signature" step:
codesign -vvv --strictEnhanced "Verify app bundle inside DMG" step:
Why this is needed
The
CodeSignOnCopyattribute in Xcode only performs basic code signing without hardened runtime or secure timestamp, which is insufficient for Homebrew Cask/Gatekeeper requirements.Related Issue
Related to #238
Manual Testing Plan
Phase 1: Workflow Verification
Phase 2: Code Signature Verification
Phase 3: Homebrew Cask Verification
Review Notes
--options runtime --timestamp