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
This commit is contained in:
程序员阿江(Relakkes) 2026-06-17 04:45:40 +08:00
parent a45d3492b1
commit f7ebe668b5
2 changed files with 8 additions and 2 deletions

View File

@ -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"

View File

@ -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')