优化 Bun 安装脚本,支持多架构下载
This commit is contained in:
@@ -56,7 +56,27 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Bun
|
- name: Install Bun
|
||||||
run: |
|
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"
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user