Skip to content

fix(ci): verify the app inside the dmg, not the removed standalone .app#49

Merged
Cmochance merged 1 commit into
mainfrom
fix/verify-dmg-codesign
May 29, 2026
Merged

fix(ci): verify the app inside the dmg, not the removed standalone .app#49
Cmochance merged 1 commit into
mainfrom
fix/verify-dmg-codesign

Conversation

@Cmochance
Copy link
Copy Markdown
Owner

@Cmochance Cmochance commented May 29, 2026

Problem

The codesign verify gate added in #48 fails every macOS release build with no codex_switch.app found to verify → macos jobs fail → no assets → no draft release.

Root cause (locally reproduced)

macos:artifacts:finalize:release removes the standalone .app (log: Removed dist/codex_switch.app) and keeps only dist/*.dmg + dist/*.pkg. So the gate's find ... -name codex_switch.app matches nothing. The dmg's app is correctly signed — the #48 ad-hoc-codesign fix works; only the verify step looked in the wrong place.

Fix

Verify the app inside the dmg (what users download): find the dmg, hdiutil attach, codesign --verify --deep --strict the app, detach.

Verified locally (dry-run on an ad-hoc release build)

dist/codex_switch_1.5.11_aarch64.dmg → mounted
/tmp/vd/codex_switch.app: valid on disk
/tmp/vd/codex_switch.app: satisfies its Designated Requirement
verify rc: 0

🤖 Generated with Claude Code


Open in Devin Review

The codesign verify gate added in #48 failed every macOS release build
with "no codex_switch.app found to verify": the release finalize step
(macos:artifacts:finalize:release) removes the standalone .app and keeps
only the dmg/pkg, so `find ... -name codex_switch.app` matched nothing.
The dmg's app itself is correctly signed (the #48 fix works).

Verify the app inside the dmg (what users download) instead: find the
dmg, hdiutil attach, codesign --verify --deep --strict the app, detach.
Dry-run locally on an ad-hoc release build: dist/*.dmg -> mounted app
verifies rc=0 ("valid on disk", "satisfies its Designated Requirement").
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

app="$(find /tmp/verify-dmg -maxdepth 2 -name '*.app' -print -quit)"
rc=1
if [[ -n "$app" ]]; then
codesign --verify --deep --strict --verbose=2 "$app"; rc=$?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 set -e causes immediate exit on codesign failure, skipping DMG detach cleanup

GitHub Actions runs shell: bash steps with set -eo pipefail by default. On line 189, codesign --verify --deep --strict --verbose=2 "$app"; rc=$? — if codesign returns non-zero, set -e terminates the script immediately before rc=$? executes. The then-body of an if statement is not exempt from set -e (only the if condition itself is exempt). This means when codesign verification fails (the exact scenario this check is designed to catch), hdiutil detach on line 193 is never reached (leaving the DMG mounted) and the descriptive error message on line 194 is never printed. The step does still fail (which is correct), but the cleanup and user-facing error message are bypassed.

The fix is to use || rc=$? or && rc=0 || rc=$? so that the non-zero exit code is captured without triggering set -e.

Suggested change
codesign --verify --deep --strict --verbose=2 "$app"; rc=$?
codesign --verify --deep --strict --verbose=2 "$app" && rc=0 || rc=$?
Open in Devin Review

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

@Cmochance Cmochance merged commit 70631ef into main May 29, 2026
4 checks passed
@Cmochance Cmochance deleted the fix/verify-dmg-codesign branch May 29, 2026 12:04
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