From f7ebe668b5bc5eaf95c2155e2bb9ccc07f18cfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Wed, 17 Jun 2026 04:45:40 +0800 Subject: [PATCH] fix(release): preserve macOS signing failure status Capture the signed macOS electron-builder exit code before the retry branch so watchdog timeouts and notarization failures fail the signed step directly instead of falling through to package-smoke.\n\nTested: bun test scripts/pr/release-workflow.test.ts\nTested: git diff --check\nTested: bun run scripts/release.ts 0.4.3 --dry\nTested: local bash watchdog timeout returns status 124\nConfidence: high\nScope-risk: narrow --- .github/workflows/release-desktop.yml | 7 +++++-- scripts/pr/release-workflow.test.ts | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 2b2add08..52e1e219 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -222,12 +222,15 @@ jobs: for attempt in $(seq 1 "$max_attempts"); do echo "Starting signed electron-builder attempt ${attempt}/${max_attempts} at $(date -u '+%Y-%m-%dT%H:%M:%SZ') with ${build_timeout_seconds}s watchdog" rm -rf build-artifacts/electron - if run_signed_electron_builder "$build_timeout_seconds" node ./node_modules/electron-builder/out/cli/cli.js ${{ matrix.builder_args }} --publish never; then + set +e + run_signed_electron_builder "$build_timeout_seconds" node ./node_modules/electron-builder/out/cli/cli.js ${{ matrix.builder_args }} --publish never + status=$? + set -e + if [ "$status" -eq 0 ]; then echo "Finished signed electron-builder attempt ${attempt}/${max_attempts} at $(date -u '+%Y-%m-%dT%H:%M:%SZ')" exit 0 fi - status=$? if [ "$attempt" -eq "$max_attempts" ]; then echo "::error::Signed electron-builder failed after ${max_attempts} attempts" exit "$status" diff --git a/scripts/pr/release-workflow.test.ts b/scripts/pr/release-workflow.test.ts index 1f44a50b..d4068da2 100644 --- a/scripts/pr/release-workflow.test.ts +++ b/scripts/pr/release-workflow.test.ts @@ -140,6 +140,9 @@ describe('release desktop workflow', () => { expect(signedBuildStep).toContain('Signed electron-builder timed out') expect(signedBuildStep).toContain('pkill -TERM -P "$build_pid"') expect(signedBuildStep).toContain('with ${build_timeout_seconds}s watchdog') + expect(signedBuildStep).toContain('set +e') + expect(signedBuildStep).toContain('status=$?') + expect(signedBuildStep).toContain('if [ "$status" -eq 0 ]; then') expect(signedBuildStep).toContain('rm -rf build-artifacts/electron') expect(signedBuildStep).toContain('Starting signed electron-builder attempt') expect(signedBuildStep).toContain('Finished signed electron-builder attempt')