From e8cdab8871f1f737cdba72e3868a6c1c296935f8 Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Sun, 1 Feb 2026 15:45:26 +0900 Subject: [PATCH] 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 --- .github/workflows/publish-platform.yml | 49 ++++++++++++++------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-platform.yml b/.github/workflows/publish-platform.yml index d2cb58f62..3828c3886 100644 --- a/.github/workflows/publish-platform.yml +++ b/.github/workflows/publish-platform.yml @@ -84,28 +84,33 @@ jobs: - name: Build binary if: steps.check.outputs.skip != 'true' - run: | - PLATFORM="${{ matrix.platform }}" - case "$PLATFORM" in - darwin-arm64) TARGET="bun-darwin-arm64" ;; - darwin-x64) TARGET="bun-darwin-x64" ;; - 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 - OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe" - else - OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode" - fi - - bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT - - echo "Built binary:" - ls -lh "$OUTPUT" + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 5 + retry_wait_seconds: 10 + command: | + PLATFORM="${{ matrix.platform }}" + case "$PLATFORM" in + darwin-arm64) TARGET="bun-darwin-arm64" ;; + darwin-x64) TARGET="bun-darwin-x64" ;; + 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 + OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode.exe" + else + OUTPUT="packages/${PLATFORM}/bin/oh-my-opencode" + fi + + bun build src/cli/index.ts --compile --minify --target=$TARGET --outfile=$OUTPUT + + echo "Built binary:" + ls -lh "$OUTPUT" - name: Compress binary if: steps.check.outputs.skip != 'true'