Files

34 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Installs everything the CI jobs need on a Debian/Ubuntu runner.
# Pass --windows to also install the tools for cross-compiling the Windows build.
set -euo pipefail
SUDO=$(command -v sudo || true)
export DEBIAN_FRONTEND=noninteractive
packages=(
build-essential curl wget file xdg-utils pkg-config
libwebkit2gtk-4.1-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev
)
if [[ "${1:-}" == "--windows" ]]; then
packages+=(nsis lld llvm clang)
fi
$SUDO apt-get update -q
$SUDO apt-get install -yq --no-install-recommends "${packages[@]}"
# mise, and the Rust it installs through rustup, may already be here from the CI cache.
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH"
command -v mise >/dev/null || curl -fsSL https://mise.run | MISE_VERSION=v2026.9.1 sh
for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.local/share/mise/shims"; do
echo "$dir" >> "$GITHUB_PATH"
done
# Node, Bun and Rust, at the versions in mise.toml.
mise trust && mise install
if [[ "${1:-}" == "--windows" ]]; then
mise exec -- rustup target add x86_64-pc-windows-msvc
command -v cargo-xwin >/dev/null || mise exec -- cargo install --locked cargo-xwin
fi
bun install --frozen-lockfile