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" ;;
if [ "$PLATFORM" = "windows-x64" ]; then linux-x64-musl) TARGET="bun-linux-x64-musl" ;;
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe" linux-arm64-musl) TARGET="bun-linux-arm64-musl" ;;
else windows-x64) TARGET="bun-windows-x64" ;;
OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode" esac
fi
if [ "$PLATFORM" = "windows-x64" ]; then
bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe"
else
echo "Built binary:" OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode"
ls -lh "$OUTPUT" fi
bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT
echo "Built binary:"
ls -lh "$OUTPUT"
- name: Compress binary - name: Compress binary
if: steps.check.outputs.skip != 'true' if: steps.check.outputs.skip != 'true'