upgrade to bun 1.3.10 canary and force baseline builds always (#14843)
This commit is contained in:
56
.github/actions/setup-bun/action.yml
vendored
56
.github/actions/setup-bun/action.yml
vendored
@@ -1,5 +1,10 @@
|
|||||||
name: "Setup Bun"
|
name: "Setup Bun"
|
||||||
description: "Setup Bun with caching and install dependencies"
|
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:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -16,13 +21,12 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "$RUNNER_ARCH" = "X64" ]; then
|
if [ "$RUNNER_ARCH" = "X64" ]; then
|
||||||
V=$(node -p "require('./package.json').packageManager.split('@')[1]")
|
|
||||||
case "$RUNNER_OS" in
|
case "$RUNNER_OS" in
|
||||||
macOS) OS=darwin ;;
|
macOS) OS=darwin ;;
|
||||||
Linux) OS=linux ;;
|
Linux) OS=linux ;;
|
||||||
Windows) OS=windows ;;
|
Windows) OS=windows ;;
|
||||||
esac
|
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
|
fi
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
@@ -31,6 +35,54 @@ runs:
|
|||||||
bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }}
|
bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }}
|
||||||
bun-download-url: ${{ steps.bun-url.outputs.url }}
|
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
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -77,6 +77,8 @@ jobs:
|
|||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: ./.github/actions/setup-bun
|
- uses: ./.github/actions/setup-bun
|
||||||
|
with:
|
||||||
|
cross-compile: "true"
|
||||||
|
|
||||||
- name: Setup git committer
|
- name: Setup git committer
|
||||||
id: committer
|
id: committer
|
||||||
@@ -88,7 +90,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
./packages/opencode/script/build.ts
|
./packages/opencode/script/build.ts --all
|
||||||
env:
|
env:
|
||||||
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
|
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
|
||||||
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
|
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
|
||||||
|
|||||||
4
.github/workflows/sign-cli.yml
vendored
4
.github/workflows/sign-cli.yml
vendored
@@ -20,10 +20,12 @@ jobs:
|
|||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: ./.github/actions/setup-bun
|
- uses: ./.github/actions/setup-bun
|
||||||
|
with:
|
||||||
|
cross-compile: "true"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./packages/opencode/script/build.ts
|
./packages/opencode/script/build.ts --all
|
||||||
|
|
||||||
- name: Upload unsigned Windows CLI
|
- name: Upload unsigned Windows CLI
|
||||||
id: upload_unsigned_windows_cli
|
id: upload_unsigned_windows_cli
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const SIDECAR_BINARIES: Array<{ rustTarget: string; ocBinary: string; ass
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
rustTarget: "x86_64-apple-darwin",
|
rustTarget: "x86_64-apple-darwin",
|
||||||
ocBinary: "opencode-darwin-x64-baseline",
|
ocBinary: "opencode-darwin-x64",
|
||||||
assetExt: "zip",
|
assetExt: "zip",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const migrations = await Promise.all(
|
|||||||
)
|
)
|
||||||
console.log(`Loaded ${migrations.length} migrations`)
|
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 baselineFlag = process.argv.includes("--baseline")
|
||||||
const skipInstall = process.argv.includes("--skip-install")
|
const skipInstall = process.argv.includes("--skip-install")
|
||||||
|
|
||||||
@@ -103,11 +103,6 @@ const allTargets: {
|
|||||||
os: "darwin",
|
os: "darwin",
|
||||||
arch: "x64",
|
arch: "x64",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
os: "darwin",
|
|
||||||
arch: "x64",
|
|
||||||
avx2: false,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
os: "win32",
|
os: "win32",
|
||||||
arch: "x64",
|
arch: "x64",
|
||||||
|
|||||||
Reference in New Issue
Block a user