Skip to content

Conversation

@henryhchchc
Copy link
Contributor

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

In the following questions <cask> is the token of the cask you're submitting.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

Link the CLI binary macdown to enable command line access.

@henryhchchc
Copy link
Contributor Author

Looks like the CLI binary is not code-signed. I opened an upstream issue: schuyler/macdown3000#238

schuyler added a commit to schuyler/macdown3000 that referenced this pull request Dec 31, 2025
## Summary

Add explicit code signing for the `macdown` CLI binary in the release
workflow to ensure it passes Homebrew Cask's signature verification.

### Changes

1. **New "Sign CLI binary explicitly" step** (after build, before
verification):
   - Signs CLI binary at `Contents/SharedSupport/bin/macdown`
   - Uses `--force --options runtime --timestamp` flags
   - Re-signs app bundle to update code signature seal

2. **Enhanced "Verify code signature" step**:
   - Verifies CLI binary signature with `codesign -vvv --strict`
   - Verifies Developer ID signing identity
   - Verifies hardened runtime flag is present

3. **Enhanced "Verify app bundle inside DMG" step**:
   - Verifies CLI binary exists in DMG
   - Verifies signature and Developer ID
   - Verifies hardened runtime flag

### Why this is needed

The `CodeSignOnCopy` attribute 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
- Trigger release workflow with a test tag
- Verify workflow completes without errors in CLI signing steps

### Phase 2: Code Signature Verification
```bash
# Verify CLI binary after mounting DMG
CLI_PATH="/Volumes/MacDown 3000/MacDown 3000.app/Contents/SharedSupport/bin/macdown"
codesign -vvv --strict "$CLI_PATH"
codesign -dvv "$CLI_PATH" 2>&1 | grep "Authority="  # Should show Developer ID
codesign -dvv "$CLI_PATH" 2>&1 | grep "flags="      # Should contain "runtime"
```

### Phase 3: Homebrew Cask Verification
- Update the Homebrew Cask PR at
Homebrew/homebrew-cask#242810
- Verify CI passes code signing checks

## Review Notes

- **Groucho (Architecture)**: Recommended adding explicit signing step
after build with `--options runtime --timestamp`
- **Chico (Code Review)**: Identified critical path issue (SharedSupport
vs MacOS) and need to re-sign app bundle; both issues fixed
- **Harpo (Docs)**: No documentation updates needed - existing docs
describe signing at appropriate level
- **Zeppo (Testing)**: Provided comprehensive manual testing plan for
verifying signatures

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants