Pin Bun 1.4.3 with packageManager, and force every bun run script onto the Bun runtime through bunfig so ng, ESLint and Prettier never fall back to an installed Node. Type checking uses bun check for the application and test projects, next to the Angular build. CI jobs install the pinned release from a checksum-verified download instead of npm and run project steps in a shell without Node on PATH, which stays available only for the checkout and upload actions. The image test's fake docker runs on Bun. Refs #290, #293 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.4 KiB
Bash
Executable File
42 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# Installs the pinned Bun release to /opt/bun/bin without npm, after verifying its SHA-256.
|
|
# Needs curl, unzip and sha256sum. Bun upgrades change the version, package.json and every checksum together.
|
|
set -eu
|
|
|
|
version=1.4.3
|
|
dest=${BUN_INSTALL_DIR:-/opt/bun}
|
|
|
|
grep -q "\"packageManager\": \"bun@${version}\"" package.json || {
|
|
echo "package.json packageManager must be bun@${version}." >&2
|
|
exit 1
|
|
}
|
|
|
|
case "$(uname -m)" in
|
|
x86_64) arch=x64 ;;
|
|
aarch64 | arm64) arch=aarch64 ;;
|
|
*)
|
|
echo "Unsupported Bun architecture: $(uname -m)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
libc=
|
|
if [ -e /etc/alpine-release ]; then libc=-musl; fi
|
|
asset="bun-linux-${arch}${libc}"
|
|
case "$asset" in
|
|
bun-linux-x64) sha256=3e730528d89775f03f87f05c06787c4df4099d0a37f3f252e7b829cb23816e18 ;;
|
|
bun-linux-x64-musl) sha256=6e9ea98554ea0d05efda5840ae292618aaa3adefd66b0853520c5c86a37eac9c ;;
|
|
bun-linux-aarch64) sha256=efa9813da5ed72423bf847f916e8d2c47c0d776add972354026a75e10da9aa21 ;;
|
|
bun-linux-aarch64-musl) sha256=8de8a0003cc2707bb555887e3d450e24e1edf3f605f491393e89ed61a8853420 ;;
|
|
esac
|
|
|
|
work=$(mktemp -d)
|
|
trap 'rm -rf "$work"' EXIT
|
|
curl --fail --location --silent --show-error \
|
|
"https://github.com/oven-sh/bun/releases/download/bun-v${version}/${asset}.zip" \
|
|
--output "$work/bun.zip"
|
|
echo "${sha256} ${work}/bun.zip" | sha256sum -c -
|
|
unzip -q "$work/bun.zip" -d "$work"
|
|
mkdir -p "${dest}/bin"
|
|
install -m 0755 "${work}/${asset}/bun" "${dest}/bin/bun"
|
|
"${dest}/bin/bun" --version
|