Files
LLeMbas-IDE/scripts/package-ide.sh
T
HomerandClaude Fable 5.2 31ede4d8d2 ide: the LLeMbas IDE distribution — one installer, a pinned Neovim, a branded configuration
A new top-level ide/: install.sh places a hash-checked Neovim release, five third-party
plugins each at one pinned commit, the LLeMbas plugin from nvim/, a generated colourscheme
and a launcher, for one user and under its own NVIM_APPNAME. Built in a staging directory,
started there once, then swapped in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 19:49:21 +00:00

55 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# What a release of LLeMbas IDE carries, written into dist/:
# llembas-ide-<version>.tar.gz ide/ (the installer, the configuration, the lock files) and
# nvim/ (the LLeMbas plugin), with VERSION and LICENSE
# install.sh the installer, for: curl -fsSL <release>/install.sh | bash
# SHA256SUMS of every release file in dist/ (the .vsix too, when it is there)
# SHA256SUMS.sig with --sign <key file>: signed with ssh-keygen in the namespace
# lembas-release, which install.sh checks once it is given the key
#
# scripts/package-ide.sh [--sign <ssh private key>]
#
# The archive is made from the files git tracks, in a fixed order with fixed times and owners, so
# the same commit gives the same bytes. The version is the repository's VERSION file.
set -euo pipefail
cd "$(dirname "$0")/.."
sign=""
while [ $# -gt 0 ]; do
case "$1" in
--sign) sign="${2:?--sign needs a key file}" && shift ;;
*) echo "package-ide: unknown option $1" >&2 && exit 2 ;;
esac
shift
done
version="$(tr -d '[:space:]' <VERSION)"
name="llembas-ide-$version"
python3 scripts/gen-ide-theme.py --check
mkdir -p dist
work="$(mktemp -d)"
trap 'rm -rf "$work"' EXIT
mkdir "$work/$name"
git ls-files -z -- VERSION LICENSE ide nvim | grep -zv -E '^(ide|nvim)/tests/' |
while IFS= read -r -d '' f; do
mkdir -p "$work/$name/$(dirname "$f")"
cp -p "$f" "$work/$name/$f"
done
chmod 755 "$work/$name/ide/install.sh" "$work/$name/ide/bin/llembas-ide"
stamp="$(git log -1 --format=%ct)"
tar -C "$work" --sort=name --mtime="@$stamp" --owner=0 --group=0 --numeric-owner -cf - "$name" | gzip -n -9 >"dist/$name.tar.gz"
cp ide/install.sh dist/install.sh
(
cd dist
files=("$name.tar.gz" install.sh)
[ ! -f "llembas-$version.vsix" ] || files+=("llembas-$version.vsix")
sha256sum "${files[@]}" >SHA256SUMS
)
rm -f dist/SHA256SUMS.sig
if [ -n "$sign" ]; then
ssh-keygen -Y sign -q -f "$sign" -n lembas-release dist/SHA256SUMS
fi
echo "package-ide: dist/$name.tar.gz, dist/install.sh, dist/SHA256SUMS$([ -z "$sign" ] || echo ", dist/SHA256SUMS.sig")"