Skip to content

Commit b04683a

Browse files
ci(desktop): fix unsigned macOS builds and Linux Electron sandbox (#89)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Fixes the `desktop-v1.0.0` CI failures that blocked publishing DeepSQL Desktop installers. After this lands, re-tag / re-run `desktop-release` so `/download` has assets. ## Root causes (from failed run) | Platform | Failure | |----------|---------| | Linux | Tunnel selftest: Electron aborts — `chrome-sandbox` lacks root:4755 on hosted runners | | macOS | `electron-builder` treated empty `CSC_LINK` (unset secret → empty string) as a file path → `…/desktop not a file` | | Windows | Cancelled after sibling failures; never reached builder | ## Changes - Selftest: `ELECTRON_DISABLE_SANDBOX=1` (sandbox irrelevant for headless CI) - Build: only export `CSC_*` when `DESKTOP_CSC_LINK` is non-empty; otherwise `CSC_IDENTITY_AUTO_DISCOVERY=false` for unsigned installers - `desktop/README.md`: document the CI behavior ## After merge ```bash # Option A — new patch tag from main git checkout main && git pull git tag -a desktop-v1.0.1 -m "DeepSQL Desktop v1.0.1" git push origin desktop-v1.0.1 # Option B — re-run workflow_dispatch on main, then attach assets manually ``` Then confirm the `desktop-v*` GitHub Release has dmg/zip/exe/AppImage/deb and `/download` lists them. ## Test plan - [ ] CI green on this PR - [ ] After merge: desktop-release succeeds on macOS + Linux + Windows - [ ] Release assets appear; `/download` no longer shows empty state <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-8ce91e70-c67b-48c6-84b3-05bb9d06231a?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-8ce91e70-c67b-48c6-84b3-05bb9d06231a&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 61e1d57 commit b04683a

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/desktop-release.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,42 @@ jobs:
4646
- name: Self-test the SSH tunnel transport
4747
# Runs a real SSH server in-process, so it needs a display-free Electron.
4848
# xvfb is only required on Linux; the other runners have a window server.
49+
#
50+
# ELECTRON_DISABLE_SANDBOX: GitHub-hosted Linux runners ship Electron's
51+
# chrome-sandbox without root:4755, so Chromium aborts with SIGTRAP
52+
# before the test starts ("SUID sandbox helper binary … is not
53+
# configured correctly"). Verified on desktop-v1.0.0. Sandbox is
54+
# irrelevant for this headless selftest.
4955
working-directory: desktop
56+
env:
57+
ELECTRON_DISABLE_SANDBOX: '1'
5058
run: ${{ matrix.os == 'ubuntu-latest' && 'xvfb-run --auto-servernum npm run selftest:tunnel' || 'npm run selftest:tunnel' }}
5159
shell: bash
5260

5361
- name: Build installers
5462
working-directory: desktop
5563
env:
56-
# Signing is skipped when these are unset; electron-builder warns and
57-
# produces unsigned artifacts rather than failing the build.
58-
CSC_LINK: ${{ secrets.DESKTOP_CSC_LINK }}
59-
CSC_KEY_PASSWORD: ${{ secrets.DESKTOP_CSC_KEY_PASSWORD }}
64+
# Keep secrets in DESKTOP_* names first. Passing an empty CSC_LINK from
65+
# an unset repository secret still counts as "set" for electron-builder,
66+
# which then tries to open it as a file and fails macOS with
67+
# "…/desktop not a file" (observed on desktop-v1.0.0). Only export the
68+
# real CSC_* / Apple vars when a signing secret is actually configured.
69+
DESKTOP_CSC_LINK: ${{ secrets.DESKTOP_CSC_LINK }}
70+
DESKTOP_CSC_KEY_PASSWORD: ${{ secrets.DESKTOP_CSC_KEY_PASSWORD }}
6071
APPLE_ID: ${{ secrets.APPLE_ID }}
6172
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
6273
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
63-
run: npx electron-builder ${{ matrix.target }} --publish never
74+
run: |
75+
set -euo pipefail
76+
if [ -n "${DESKTOP_CSC_LINK:-}" ]; then
77+
export CSC_LINK="$DESKTOP_CSC_LINK"
78+
export CSC_KEY_PASSWORD="${DESKTOP_CSC_KEY_PASSWORD:-}"
79+
else
80+
export CSC_IDENTITY_AUTO_DISCOVERY=false
81+
echo "No DESKTOP_CSC_LINK secret — building unsigned installers."
82+
fi
83+
npx electron-builder ${{ matrix.target }} --publish never
84+
shell: bash
6485

6586
- uses: actions/upload-artifact@v4
6687
with:

desktop/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ environment variables to enable it:
9191
- macOS: `CSC_LINK`, `CSC_KEY_PASSWORD`, plus `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID` for notarisation.
9292
- Windows: `CSC_LINK`, `CSC_KEY_PASSWORD` (or an Azure Trusted Signing config).
9393

94+
CI (`.github/workflows/desktop-release.yml`) builds **unsigned** installers unless
95+
the repository secret `DESKTOP_CSC_LINK` is set. An empty `CSC_LINK` still counts
96+
as configured for electron-builder and fails the macOS job — the workflow only
97+
exports `CSC_*` when that secret is non-empty, and otherwise sets
98+
`CSC_IDENTITY_AUTO_DISCOVERY=false`. Linux selftests set `ELECTRON_DISABLE_SANDBOX=1`
99+
because hosted runners lack a correctly permissioned `chrome-sandbox`.
100+
94101
**Auto-update** is opt-in. `package.json` sets `"publish": null`, so no update
95102
feed is baked in and the updater no-ops. To enable it, either set a `publish`
96103
target (GitHub Releases, S3, generic) before building, or point

0 commit comments

Comments
 (0)