Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
31658df
ci: use bun baseline build to avoid segfaults
Hona Feb 24, 2026
ec4c395
ci: map macOS to darwin in bun download URL
Hona Feb 24, 2026
c31a335
ci: only use baseline for x64 runners, let ARM64 use default
Hona Feb 24, 2026
66c4eb3
ci: downgrade bun to 1.3.8 for working baseline support
Hona Feb 24, 2026
c845661
Merge remote-tracking branch 'upstream/dev' into fix/use-baseline
Hona Feb 24, 2026
587deef
ci: use GitHub release URLs for baseline (bun.sh ignores avx2 on Wind…
Hona Feb 24, 2026
9ae32d1
ci: revert bun to 1.3.9 (baseline now uses GitHub release URLs)
Hona Feb 24, 2026
ce4a2d0
ci: downgrade bun to 1.3.8
Hona Feb 24, 2026
02c0e96
ci: downgrade bun to 1.3.5
Hona Feb 24, 2026
bf57596
ci: upgrade to bun canary
Hona Feb 24, 2026
13973dd
ci: use canary baseline build directly from GitHub releases
Hona Feb 24, 2026
b0a7dfe
ci: restore @types/bun to 1.3.9
Hona Feb 24, 2026
d250de6
ci: default to --single build in CI to avoid canary cross-compile fai…
Hona Feb 24, 2026
61547f4
ci: override cross-compile tarball URL for canary builds
Hona Feb 24, 2026
fe0c3ca
ci: remove --single CI default now that canary cross-compile is handled
Hona Feb 24, 2026
d9ee41a
ci: pre-cache canary cross-compile binaries via opt-in input
Hona Feb 24, 2026
9c50c06
ci: default to --single in CI, publish passes --all
Hona Feb 24, 2026
5374245
ci: pass --all and cross-compile to sign-cli build
Hona Feb 24, 2026
f53a7c2
ci: fix non-portable grep -oP in pre-cache step
Hona Feb 24, 2026
7f77bb1
ci: add debug output and use bun instead of node for npm json parsing
Hona Feb 24, 2026
e08bdeb
ci: use bun --revision to detect canary (--version strips it)
Hona Feb 24, 2026
71eed6f
ci: handle bun.exe for Windows targets in pre-cache
Hona Feb 24, 2026
4285c50
ci: download cross-compile binaries from GitHub canary release (same …
Hona Feb 24, 2026
2814fe2
ci: drop darwin-x64-baseline target (no Mac needs it) and alias moder…
Hona Feb 24, 2026
05ad2f9
ci: switch desktop sidecar to modern darwin-x64 (all Intel Macs have …
Hona Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions .github/actions/setup-bun/action.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
fetch-tags: true

- uses: ./.github/actions/setup-bun
with:
cross-compile: "true"

- name: Setup git committer
id: committer
Expand All @@ -88,7 +90,7 @@ jobs:
- name: Build
id: build
run: |
./packages/opencode/script/build.ts
./packages/opencode/script/build.ts --all
env:
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/sign-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
fetch-tags: true

- uses: ./.github/actions/setup-bun
with:
cross-compile: "true"

- name: Build
run: |
./packages/opencode/script/build.ts
./packages/opencode/script/build.ts --all

- name: Upload unsigned Windows CLI
id: upload_unsigned_windows_cli
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const SIDECAR_BINARIES: Array<{ rustTarget: string; ocBinary: string; ass
},
{
rustTarget: "x86_64-apple-darwin",
ocBinary: "opencode-darwin-x64-baseline",
ocBinary: "opencode-darwin-x64",
assetExt: "zip",
},
{
Expand Down
7 changes: 1 addition & 6 deletions packages/opencode/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const migrations = await Promise.all(
)
console.log(`Loaded ${migrations.length} migrations`)

const singleFlag = process.argv.includes("--single")
const singleFlag = process.argv.includes("--single") || (!!process.env.CI && !process.argv.includes("--all"))
const baselineFlag = process.argv.includes("--baseline")
const skipInstall = process.argv.includes("--skip-install")

Expand Down Expand Up @@ -103,11 +103,6 @@ const allTargets: {
os: "darwin",
arch: "x64",
},
{
os: "darwin",
arch: "x64",
avx2: false,
},
{
os: "win32",
arch: "x64",
Expand Down
Loading