File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 run : pnpm run build:all
3939
4040 - name : Publish preview packages
41- run :
42- pnpm dlx pkg-pr-new publish --packageManager=npm --pnpm './packages/server' './packages/client'
43- ' ./packages/middleware/express' ' ./packages/middleware/hono' ' ./packages/middleware/node'
41+ shell : bash
42+ run : |
43+ set -euo pipefail
44+
45+ # pkg.pr.new can occasionally return transient 5xx/Cloudflare errors.
46+ # Retry a few times to reduce CI flake without masking real failures.
47+ for attempt in 1 2 3; do
48+ tmp="$(mktemp)"
49+ if pnpm dlx pkg-pr-new publish --packageManager=npm --pnpm \
50+ './packages/server' \
51+ './packages/client' \
52+ './packages/middleware/express' \
53+ './packages/middleware/hono' \
54+ './packages/middleware/node' \
55+ 2>&1 | tee "$tmp"; then
56+ exit 0
57+ fi
58+
59+ if grep -Eq 'Check failed \\(5[0-9]{2}\\)|Cloudflare|Worker threw exception' "$tmp"; then
60+ echo "pkg-pr-new publish failed with a transient-looking error (attempt $attempt/3). Retrying..." >&2
61+ sleep "$((attempt * 10))"
62+ continue
63+ fi
64+
65+ echo "pkg-pr-new publish failed with a non-transient error; not retrying." >&2
66+ exit 1
67+ done
68+
69+ echo "pkg-pr-new publish failed after retries." >&2
70+ exit 1
You can’t perform that action at this time.
0 commit comments