codeburn/desktop/Scripts/provision-linux.sh
AgentSeal a05dabf12b feat(desktop): Windows MSI build + tray + CLI discovery
Windows-specific pieces that were stubbed or missing:

- icon.ico multi-resolution (16/24/32/48/64/128/256) so the MSI bundler
  and the Windows taskbar/installer get a proper app icon. Generated from
  icons/icon.png with ImageMagick; also listed in tauri.conf.json.
- cli.rs defaults program to 'codeburn.cmd' on Windows because npm installs
  a cmd shim, not an .exe, and std::process::Command does not guarantee
  PATHEXT resolution for extensionless names.
- cli.rs is_safe_arg now accepts '\\', ':', '(', ')' on Windows so a user
  supplied CODEBURN_BIN like C:\\Users\\...\\codeburn.cmd is not rejected.
  These are not shell metacharacters in a direct-argv spawn; we never
  invoke sh -c or cmd /c with string interpolation.
- spawn_in_terminal on Windows now passes an explicit empty title to
  'start' so the program name is not eaten as the window title.
- release-desktop-windows.yml mirrors the Linux release workflow on
  windows-latest. Triggered by 'win-v*' tag or workflow_dispatch. Caches
  Cargo, runs 'npm run tauri build', uploads .msi/.exe to a GitHub Release
  (or an artifact on manual runs).

Also drops the AgentSeal/codeburn URLs that pre-date the getagentseal org
rename so new pulls hit the canonical URL instead of the 301.
2026-04-18 15:52:22 -07:00

89 lines
2.9 KiB
Bash
Executable file

#!/usr/bin/env bash
# One-shot Ubuntu provisioning for the CodeBurn desktop (Tauri) dev environment.
#
# Usage inside a fresh Ubuntu 24.04 LTS Server VM (after `sudo apt install
# ubuntu-desktop-minimal && sudo reboot`, and logging into GNOME):
#
# curl -fsSL https://raw.githubusercontent.com/getagentseal/codeburn/feat/tauri-menubar-win-linux/desktop/Scripts/provision-linux.sh | bash
#
# Or if you cloned the repo manually: `bash desktop/Scripts/provision-linux.sh`.
#
# Installs: build toolchain, webkit + appindicator headers, Node 20 LTS, Rust stable,
# the codeburn npm CLI, and this repo. Leaves you one command away from `npm run tauri dev`.
set -euo pipefail
REPO_URL="https://github.com/getagentseal/codeburn.git"
BRANCH="feat/tauri-menubar-win-linux"
CHECKOUT="${HOME}/codeburn"
log() { printf '\033[1;34m▸\033[0m %s\n' "$*"; }
fail() { printf '\033[1;31m✗\033[0m %s\n' "$*" >&2; exit 1; }
# 1. Platform sanity
[[ "$(uname -s)" == "Linux" ]] || fail "Run me on Linux (detected: $(uname -s))."
if ! command -v apt-get >/dev/null; then
fail "Only apt-based distros supported by this provisioner (Ubuntu, Debian)."
fi
log "apt update + system build deps"
sudo apt-get update -qq
sudo apt-get install -y \
build-essential curl wget file git \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libssl-dev \
libxdo-dev \
libgtk-3-dev \
pkg-config
# 2. Node 20 LTS via NodeSource if the distro version is too old. Tauri CLI needs >= 18.
if ! command -v node >/dev/null || [[ "$(node -v | sed 's/v\([0-9]*\).*/\1/')" -lt 18 ]]; then
log "installing Node 20 LTS"
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
fi
# 3. Rust via rustup if not present
if ! command -v cargo >/dev/null; then
log "installing Rust via rustup"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
# shellcheck disable=SC1091
source "$HOME/.cargo/env"
fi
# 4. codeburn CLI (the Tauri app shells out to this for data)
if ! command -v codeburn >/dev/null; then
log "installing codeburn CLI from npm"
sudo npm install -g codeburn
fi
# 5. Repo
if [[ -d "${CHECKOUT}/.git" ]]; then
log "updating existing checkout at ${CHECKOUT}"
git -C "${CHECKOUT}" fetch origin
git -C "${CHECKOUT}" checkout "${BRANCH}"
git -C "${CHECKOUT}" pull --ff-only origin "${BRANCH}"
else
log "cloning ${REPO_URL} into ${CHECKOUT}"
git clone --branch "${BRANCH}" "${REPO_URL}" "${CHECKOUT}"
fi
# 6. npm deps for the desktop app
log "npm install for desktop/"
(cd "${CHECKOUT}/desktop" && npm install --no-audit --no-fund)
# 7. Summary + next step
cat <<EOF
\033[1;32m✓\033[0m Provisioning complete.
Next:
cd ${CHECKOUT}/desktop
npm run tauri dev
A flame tray icon should appear in your panel. Click it for the popover. Hot reload is
wired for the React code; Rust changes need a rebuild.
EOF