mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
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:
parent
a45d3492b1
commit
f7ebe668b5
7
.github/workflows/release-desktop.yml
vendored
7
.github/workflows/release-desktop.yml
vendored
@ -222,12 +222,15 @@ jobs:
|
|||||||
for attempt in $(seq 1 "$max_attempts"); do
|
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"
|
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
|
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')"
|
echo "Finished signed electron-builder attempt ${attempt}/${max_attempts} at $(date -u '+%Y-%m-%dT%H:%M:%SZ')"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
status=$?
|
|
||||||
if [ "$attempt" -eq "$max_attempts" ]; then
|
if [ "$attempt" -eq "$max_attempts" ]; then
|
||||||
echo "::error::Signed electron-builder failed after ${max_attempts} attempts"
|
echo "::error::Signed electron-builder failed after ${max_attempts} attempts"
|
||||||
exit "$status"
|
exit "$status"
|
||||||
|
|||||||
@ -140,6 +140,9 @@ describe('release desktop workflow', () => {
|
|||||||
expect(signedBuildStep).toContain('Signed electron-builder timed out')
|
expect(signedBuildStep).toContain('Signed electron-builder timed out')
|
||||||
expect(signedBuildStep).toContain('pkill -TERM -P "$build_pid"')
|
expect(signedBuildStep).toContain('pkill -TERM -P "$build_pid"')
|
||||||
expect(signedBuildStep).toContain('with ${build_timeout_seconds}s watchdog')
|
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('rm -rf build-artifacts/electron')
|
||||||
expect(signedBuildStep).toContain('Starting signed electron-builder attempt')
|
expect(signedBuildStep).toContain('Starting signed electron-builder attempt')
|
||||||
expect(signedBuildStep).toContain('Finished signed electron-builder attempt')
|
expect(signedBuildStep).toContain('Finished signed electron-builder attempt')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user