优化 Bun 安装脚本,简化代码结构

This commit is contained in:
2026-05-19 11:32:24 +08:00
parent 0ad3bd4d89
commit 4690a0980b
+19 -19
View File
@@ -56,27 +56,27 @@ jobs:
- name: Install Bun
run: |
case "$(uname -m)" in
x86_64)
BUN_ARCH="x64"
;;
aarch64|arm64)
BUN_ARCH="aarch64"
;;
*)
echo "Unsupported architecture: $(uname -m)"
exit 1
;;
esac
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}"
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"
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