2025-11-02 23:37:11 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
# Build Arch packages for Solstice CI components.
|
|
|
|
|
# Requires: Arch Linux with base-devel, rust, cargo, makepkg.
|
|
|
|
|
# Outputs: pkg files under packaging/arch/*/*.pkg.tar.*
|
|
|
|
|
|
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/../../../" && pwd)
|
|
|
|
|
cd "$ROOT_DIR"
|
|
|
|
|
|
|
|
|
|
# Create a clean source tarball of the repository
|
|
|
|
|
TARBALL="solstice-ci.tar.gz"
|
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
|
trap 'rm -rf "$TMPDIR"' EXIT
|
|
|
|
|
|
2025-11-08 20:21:57 +00:00
|
|
|
# Create a tarball with a top-level solstice-ci/ prefix so PKGBUILDs can `cd "$srcdir/solstice-ci"`
|
|
|
|
|
# Use git archive to ensure only tracked files are included and the prefix is present.
|
|
|
|
|
git archive --format=tar.gz --prefix=solstice-ci/ -o "$TMPDIR/$TARBALL" HEAD
|
2025-11-02 23:37:11 +01:00
|
|
|
|
|
|
|
|
for pkg in solstice-orchestrator solstice-forge-integration; do
|
|
|
|
|
PKG_DIR="$ROOT_DIR/packaging/arch/$pkg"
|
|
|
|
|
mkdir -p "$PKG_DIR"
|
|
|
|
|
cp "$TMPDIR/$TARBALL" "$PKG_DIR/$TARBALL"
|
|
|
|
|
( cd "$PKG_DIR" && makepkg -fC --noconfirm )
|
|
|
|
|
echo "Built package(s) in $PKG_DIR:" >&2
|
|
|
|
|
ls -1 "$PKG_DIR"/*.pkg.tar.* 2>/dev/null || true
|
|
|
|
|
done
|