feat: restore CI/release, prompt contracts, faster install (0.9.33)
Bring back Gitea CI + auto-publish; share release helpers; strengthen multi-turn tool/job prompts with a unit contract; ccache/make help and --release bootstrap. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
# dist/cst-agent-VERSION-linux-ARCH.tar.gz (+ .sha256).
|
||||
# scripts/package_linux.sh x86_64|x86|aarch64
|
||||
# CST_LINUX_CHECK=1 also runs `make check` (only where the binaries can run).
|
||||
# Builds in the source tree, so the tree is cleaned first.
|
||||
# CST_FORCE_REBUILD=1 forces a clean tree; otherwise same compiler+version
|
||||
# reuses object files (much faster CI/local repacks).
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
# shellcheck source=lib_release.sh
|
||||
. "$ROOT/scripts/lib_release.sh"
|
||||
ARCH="${1:?usage: $0 x86_64|x86|aarch64}"
|
||||
PREFIX="$ROOT/third_party/prefix-linux-$ARCH"
|
||||
cd "$ROOT"
|
||||
@@ -24,9 +27,20 @@ unset PKG_CONFIG_PATH CC CFLAGS LDFLAGS
|
||||
mk=(make CC="${T}gcc" AR="${T}ar" STATIC=1
|
||||
CFLAGS="-std=c11 -Wall -Wextra -O2 -g -Werror")
|
||||
|
||||
make clean >/dev/null
|
||||
make -C vendor/sashidown clean >/dev/null 2>&1 || true
|
||||
stamp=".gen/release-linux-$ARCH.stamp"
|
||||
want="$(cst_build_stamp "${T}gcc")"
|
||||
if [[ "${CST_FORCE_REBUILD:-0}" == 1 || ! -f cst-agent || ! -f "$stamp" ||
|
||||
"$(cat "$stamp" 2>/dev/null || true)" != "$want" ]]; then
|
||||
echo "==> clean rebuild ($ARCH)"
|
||||
make clean >/dev/null
|
||||
make -C vendor/sashidown clean >/dev/null 2>&1 || true
|
||||
else
|
||||
echo "==> incremental rebuild ($ARCH, stamp match)"
|
||||
fi
|
||||
"${mk[@]}" -j"$(nproc)" cst-agent
|
||||
mkdir -p .gen
|
||||
printf '%s\n' "$want" >"$stamp"
|
||||
|
||||
if "${T}readelf" -l cst-agent | grep -q 'Requesting program interpreter'; then
|
||||
echo "cst-agent is dynamically linked" >&2
|
||||
exit 1
|
||||
@@ -35,7 +49,7 @@ if [[ "${CST_LINUX_CHECK:-0}" == 1 ]]; then
|
||||
"${mk[@]}" check
|
||||
fi
|
||||
|
||||
ver="$(sed -n 's/^#define CST_VERSION_\(MAJOR\|MINOR\|PATCH\) \([0-9]*\)$/\2/p' include/cst_version.h | paste -sd.)"
|
||||
ver="$(cst_version)"
|
||||
name="cst-agent-$ver-linux-$ARCH"
|
||||
rel="dist/$name"
|
||||
rm -rf "$rel"
|
||||
@@ -44,8 +58,6 @@ cp -f cst-agent "$rel/cst-agent"
|
||||
"${T}strip" "$rel/cst-agent"
|
||||
cp -f README.md "$rel/README.md"
|
||||
echo "$ver" >"$rel/VERSION"
|
||||
tgz="dist/$name.tar.gz"
|
||||
tar -C dist -czf "$tgz" "$name"
|
||||
(cd dist && sha256sum "$name.tar.gz" >"$name.tar.gz.sha256")
|
||||
tgz="$(cst_pack_tgz dist "$name")"
|
||||
ls -la "$rel"
|
||||
echo "$ROOT/$tgz"
|
||||
|
||||
Reference in New Issue
Block a user