Skip to content

ci(desktop): fix release signing and allow attaching the app to an existing release - #95

Merged
guhcostan merged 1 commit into
mainfrom
claude/magical-davinci-m4n040
Sep 30, 2026
Merged

guhcostan merged 1 commit into
mainfrom
claude/magical-davinci-m4n040

Conversation

@guhcostan

Copy link
Copy Markdown
Owner

What does this PR do?

Fixes the Desktop App build that failed on the v1.4.0 release (run):

• empty password will be used for code signing  reason=CSC_KEY_PASSWORD is not defined
⨯ /Users/runner/work/mac-cleaner-cli/mac-cleaner-cli/desktop not a file

Root cause: the signing secrets aren't configured, so CSC_LINK arrives as an empty string. electron-builder only skips signing when CSC_LINK is null. An empty string goes to importCertificate(""), which resolves to the current directory and fails with "not a file". I reproduced this locally with the same electron-builder version. Pull request builds never hit it because electron-builder skips signing on PRs by default.

Changes (.github/workflows/desktop.yml only):

  • When no certificate is configured, unset CSC_LINK/CSC_KEY_PASSWORD before building. electron-builder then falls back to the ad-hoc identity (-) already set in electron-builder.config.cjs.
  • Set CSC_FOR_PULL_REQUEST=true so PR builds sign exactly like releases. This PR's own CI therefore exercises the fixed path. Fork PRs never receive secrets, so this only affects same-repo PRs.
  • workflow_dispatch takes an optional tag. It checks out that tag, builds it and uploads the .dmg/.zip to its release. The tag goes through an env var, not interpolated into the script. This is how v1.4.0 gets its app after this merges: a rerun of the failed job would use the old workflow file from the tag.

Type of change

  • Bug fix
  • New feature (new scanner, command, or option)
  • Improvement to existing feature
  • Chore / dependency update
  • Documentation

Related issue

Follow-up to #91 (release 1.4.0).

Checklist

  • bun run lint passes (no source changes)
  • bun run test passes (no source changes)
  • bun run build succeeds
  • New tests added for new behavior: CI-only change; the PR's own Desktop App job is the test
  • I've tested this on macOS locally

Notes for reviewer

The npm publish for 1.4.0 also failed, with 404 Not Found - PUT https://registry.npmjs.org/mac-cleaner-cli. That comes from the NPM_TOKEN secret, not from code: the token no longer has publish rights, most likely because it expired. It needs a new token in the repo secrets, then a re-run of the failed publish job.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QnDqAyRdicRYnwAAXydYoB


Generated by Claude Code

…isting release

- Secrets that are not configured arrive as empty strings; electron-builder
  treats an empty CSC_LINK as a certificate path and fails with
  "<dir> not a file", which broke the v1.4.0 release build. Unset the
  signing variables when no certificate is configured so the build falls
  back to ad-hoc signing.
- Set CSC_FOR_PULL_REQUEST so pull request builds sign too: electron-builder
  skips signing on PRs by default, which is why PR CI never caught this.
- workflow_dispatch accepts a tag: it builds that tag and uploads the
  .dmg/.zip to its release, to fill in v1.4.0 and any future release whose
  build needs a retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnDqAyRdicRYnwAAXydYoB
@guhcostan
guhcostan merged commit 82ea7ca into main Sep 30, 2026
7 checks passed
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