Skip to content

Commit 67f23ed

Browse files
ci(desktop): fix unsigned macOS builds and Linux Electron sandbox
desktop-v1.0.0 failed on all platforms before attach-to-release: Linux selftest aborted on chrome-sandbox SUID; macOS electron-builder treated empty CSC_LINK as a file path. Only export signing env when DESKTOP_CSC_LINK is set; otherwise disable identity discovery. Disable the Chromium sandbox for CI tunnel selftests. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 61e1d57 commit 67f23ed

1 file changed

Lines changed: 26 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:

0 commit comments

Comments
 (0)