Files
g15keyboard/packaging/local-build.sh
T

23 lines
878 B
Bash
Raw Normal View History

#!/bin/bash
# Populates repo-local dist/ (Debian packages) and bin/ (plain executables),
# reusing the same scripts the Gitea and GitHub workflows run: build.sh and
# test.sh directly when already inside the disposable packaging container
# (e.g. this devcontainer), otherwise run.sh to build that container via Docker.
set -euo pipefail
root=$(cd -- "$(dirname -- "$0")/.." && pwd)
dist="$root/dist"
bindir="$root/bin"
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
if [[ -f /.dockerenv && $EUID == 0 ]]; then
apt-get update
bash "$root/packaging/build.sh" "$work"
bash "$root/packaging/test.sh" "$work"
else
bash "$root/packaging/run.sh" "$work"
fi
rm -rf "$dist" "$bindir"
mkdir -p "$dist" "$bindir"
cp "$work"/* "$dist/"
bash "$root/packaging/extract-binaries.sh" "$dist" "$bindir"
echo "PASS: Debian packages in $dist, plain executables/libraries in $bindir"