fix(ci): add retry logic for platform binary builds

- Use nick-fields/retry@v3 for Build binary step
- 5 minute timeout per attempt
- Max 5 attempts with 10s wait between retries
- Prevents infinite hang on Bun cross-compile network issues
This commit is contained in:
justsisyphus 2026-02-01 15:45:26 +09:00
parent f146aeff0f
commit e8cdab8871

View File

@ -84,28 +84,33 @@ jobs:
- name: Build binary - name: Build binary
if: steps.check.outputs.skip != 'true' if: steps.check.outputs.skip != 'true'
run: | uses: nick-fields/retry@v3
PLATFORM="${{ matrix.platform }}" with:
case "$PLATFORM" in timeout_minutes: 5
darwin-arm64) TARGET="bun-darwin-arm64" ;; max_attempts: 5
darwin-x64) TARGET="bun-darwin-x64" ;; retry_wait_seconds: 10
linux-x64) TARGET="bun-linux-x64" ;; command: |
linux-arm64) TARGET="bun-linux-arm64" ;; PLATFORM="${{ matrix.platform }}"
linux-x64-musl) TARGET="bun-linux-x64-musl" ;; case "$PLATFORM" in
linux-arm64-musl) TARGET="bun-linux-arm64-musl" ;; darwin-arm64) TARGET="bun-darwin-arm64" ;;
windows-x64) TARGET="bun-windows-x64" ;; darwin-x64) TARGET="bun-darwin-x64" ;;
esac linux-x64) TARGET="bun-linux-x64" ;;
linux-arm64) TARGET="bun-linux-arm64" ;;
linux-x64-musl) TARGET="bun-linux-x64-musl" ;;
linux-arm64-musl) TARGET="bun-linux-arm64-musl" ;;
windows-x64) TARGET="bun-windows-x64" ;;
esac
if [ "$PLATFORM" = "windows-x64" ]; then if [ "$PLATFORM" = "windows-x64" ]; then
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe" OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe"
else else
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode" OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode"
fi fi
bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT
echo "Built binary:" echo "Built binary:"
ls -lh "$OUTPUT" ls -lh "$OUTPUT"
- name: Compress binary - name: Compress binary
if: steps.check.outputs.skip != 'true' if: steps.check.outputs.skip != 'true'