summaryrefslogtreecommitdiffhomepage
path: root/.github/actions
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2026-02-24 16:06:45 +1000
committerGitHub <[email protected]>2026-02-24 16:06:45 +1000
commitcf5cfb48cd756ebd59e6c5005d64c307f76b7424 (patch)
tree5c08c8e15c9714784157d5c28ae19bb523140a45 /.github/actions
parentae190038f89c1fd6267c3e847a182343aa31573f (diff)
downloadopencode-cf5cfb48cd756ebd59e6c5005d64c307f76b7424.tar.gz
opencode-cf5cfb48cd756ebd59e6c5005d64c307f76b7424.zip
upgrade to bun 1.3.10 canary and force baseline builds always (#14843)
Diffstat (limited to '.github/actions')
-rw-r--r--.github/actions/setup-bun/action.yml56
1 files changed, 54 insertions, 2 deletions
diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml
index 47267775c..e7966cb48 100644
--- a/.github/actions/setup-bun/action.yml
+++ b/.github/actions/setup-bun/action.yml
@@ -1,5 +1,10 @@
name: "Setup Bun"
description: "Setup Bun with caching and install dependencies"
+inputs:
+ cross-compile:
+ description: "Pre-cache canary cross-compile binaries for all targets"
+ required: false
+ default: "false"
runs:
using: "composite"
steps:
@@ -16,13 +21,12 @@ runs:
shell: bash
run: |
if [ "$RUNNER_ARCH" = "X64" ]; then
- V=$(node -p "require('./package.json').packageManager.split('@')[1]")
case "$RUNNER_OS" in
macOS) OS=darwin ;;
Linux) OS=linux ;;
Windows) OS=windows ;;
esac
- echo "url=https://bun.sh/download/${V}/${OS}/x64?avx2=false&profile=false" >> "$GITHUB_OUTPUT"
+ echo "url=https://github.com/oven-sh/bun/releases/download/canary/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT"
fi
- name: Setup Bun
@@ -31,6 +35,54 @@ runs:
bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }}
bun-download-url: ${{ steps.bun-url.outputs.url }}
+ - name: Pre-cache canary cross-compile binaries
+ if: inputs.cross-compile == 'true'
+ shell: bash
+ run: |
+ BUN_VERSION=$(bun --revision)
+ if echo "$BUN_VERSION" | grep -q "canary"; then
+ SEMVER=$(echo "$BUN_VERSION" | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
+ echo "Bun version: $BUN_VERSION (semver: $SEMVER)"
+ CACHE_DIR="$HOME/.bun/install/cache"
+ mkdir -p "$CACHE_DIR"
+ TMP_DIR=$(mktemp -d)
+ for TARGET in linux-aarch64 linux-x64 linux-x64-baseline linux-aarch64-musl linux-x64-musl linux-x64-musl-baseline darwin-aarch64 darwin-x64 windows-x64 windows-x64-baseline; do
+ DEST="$CACHE_DIR/bun-${TARGET}-v${SEMVER}"
+ if [ -f "$DEST" ]; then
+ echo "Already cached: $DEST"
+ continue
+ fi
+ URL="https://github.com/oven-sh/bun/releases/download/canary/bun-${TARGET}.zip"
+ echo "Downloading $TARGET from $URL"
+ if curl -sfL -o "$TMP_DIR/bun.zip" "$URL"; then
+ unzip -qo "$TMP_DIR/bun.zip" -d "$TMP_DIR"
+ if echo "$TARGET" | grep -q "windows"; then
+ BIN_NAME="bun.exe"
+ else
+ BIN_NAME="bun"
+ fi
+ mv "$TMP_DIR/bun-${TARGET}/$BIN_NAME" "$DEST"
+ chmod +x "$DEST"
+ rm -rf "$TMP_DIR/bun-${TARGET}" "$TMP_DIR/bun.zip"
+ echo "Cached: $DEST"
+ # baseline bun resolves "bun-darwin-x64" to the baseline cache key
+ # so copy the modern binary there too
+ if [ "$TARGET" = "darwin-x64" ]; then
+ BASELINE_DEST="$CACHE_DIR/bun-darwin-x64-baseline-v${SEMVER}"
+ if [ ! -f "$BASELINE_DEST" ]; then
+ cp "$DEST" "$BASELINE_DEST"
+ echo "Cached (baseline alias): $BASELINE_DEST"
+ fi
+ fi
+ else
+ echo "Skipped: $TARGET (not available)"
+ fi
+ done
+ rm -rf "$TMP_DIR"
+ else
+ echo "Not a canary build ($BUN_VERSION), skipping pre-cache"
+ fi
+
- name: Install dependencies
run: bun install
shell: bash