优化 Bun 安装脚本,支持多架构下载

This commit is contained in:
2026-05-19 11:16:50 +08:00
parent 38644bf5a9
commit ad34cbeab3
+21 -1
View File
@@ -56,7 +56,27 @@ jobs:
- name: Install Bun
run: |
GITHUB="https://ghproxy.net/https://github.com" curl -fsSL https://bun.sh/install | bash
case "$(uname -m)" in
x86_64)
BUN_ARCH="x64"
;;
aarch64|arm64)
BUN_ARCH="aarch64"
;;
*)
echo "Unsupported architecture: $(uname -m)"
exit 1
;;
esac
BUN_ASSET="bun-linux-${BUN_ARCH}.zip"
BUN_MIRROR_URL="https://ghproxy.net/https://github.com/oven-sh/bun/releases/latest/download/${BUN_ASSET}"
curl -fL --retry 3 --retry-delay 5 "$BUN_MIRROR_URL" -o /tmp/bun.zip
rm -rf "$HOME/.bun"
mkdir -p "$HOME/.bun/bin"
unzip -qo /tmp/bun.zip -d /tmp
install -m 0755 "/tmp/bun-linux-${BUN_ARCH}/bun" "$HOME/.bun/bin/bun"
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
- name: Install dependencies