ci: add CI/CD pipelines and deterministic release tooling

Modeled on cflmy/marqdo-cli:
- Woodpecker pipeline with fmt/clippy/tests, MSRV 1.89 lane, a lane that builds
  the pinned core CLI and runs the real Analysis integration tests, and a
  tag-only release lane
- GitHub Actions mirror with the same gates plus artifact upload and
  prerelease publication
- scripts/ci.sh local lanes (test/minimum/core/release/all)
- package-release.sh now refuses a dirty tree or SOURCE_SHA mismatch, runs a
  locked release build and records SOURCE_SHA, RELEASE_INFO.json and SHA-256
- verify-release.sh cold-installs the archive into an isolated MARQDO_TOOL_HOME
  and runs the documented install/help/compile/query/check/remove smoke path
- docs/ci.md and docs/releasing.md document gates, explicit non-gates and the
  beta freeze/tag procedure
This commit is contained in:
marqdo-knowledge committed 2026-11-26 09:01:13 +08:00
1 parent 66be3e4464
commit d8d439e6d7
7 files changed
+467 -40

No files matched your search

Executable
+76
View File
@@ -0,0 +1,76 @@
#!/bin/sh
# Local CI lanes mirroring .woodpecker/main.yml and .github/workflows/ci.yml.
#
# scripts/ci.sh test fmt + clippy + locked workspace tests
# scripts/ci.sh minimum MSRV check on Rust 1.89 (requires rustup)
# scripts/ci.sh core build the pinned core CLI + real-Analysis tests
# scripts/ci.sh release release build, package archive, cold-install smoke
# scripts/ci.sh all test + core (if available) + release
#
# Environment:
# MARQDO_BIN real core CLI binary (required for core/release lanes)
# CORE_SHA pinned marqdo-cli commit (default: rc.4 baseline)
# CORE_REPO marqdo-cli git URL (default: GitHub)
# ALLOW_DIRTY=1 permit packaging from a dirty tree (never used by CI)
set -eu
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
CARGO="$ROOT/scripts/cargo.sh"
CORE_SHA=${CORE_SHA:-4bbefc92449ee480c8a2c89b0308feb4cda8d0e7}
CORE_REPO=${CORE_REPO:-https://github.com/cflmy/marqdo-cli}
LANE=${1:-all}
cd "$ROOT"
lane_test() {
echo "== lane: test =="
"$CARGO" fmt --all -- --check
"$CARGO" clippy --all-targets --locked -- -D warnings
"$CARGO" test --workspace --locked
}
lane_minimum() {
echo "== lane: minimum-rust =="
if ! rustup toolchain list 2>/dev/null | grep -q '^1\.89'; then
rustup toolchain install 1.89 --profile minimal
fi
cargo +1.89 check --locked --workspace --all-targets
}
lane_core() {
echo "== lane: core-analysis =="
if [ -n "${MARQDO_BIN:-}" ] && [ -x "${MARQDO_BIN:-}" ]; then
echo "using MARQDO_BIN=$MARQDO_BIN"
else
CORE_DIR=$(mktemp -d)
trap 'rm -rf "$CORE_DIR"' EXIT
git clone --quiet "$CORE_REPO" "$CORE_DIR/marqdo-cli"
( cd "$CORE_DIR/marqdo-cli" && git checkout --quiet "$CORE_SHA" \
&& cargo build --release --locked -p marqdo-cli )
MARQDO_BIN="$CORE_DIR/marqdo-cli/target/release/marqdo"
export MARQDO_BIN
fi
"$MARQDO_BIN" --version
MARQDO_TEST_BIN="$MARQDO_BIN" "$CARGO" test --workspace --locked
"$CARGO" build --locked
"$ROOT/target/debug/marqdo-knowledge" check "$ROOT/examples/mixed" --json >/dev/null 2>&1 || true
}
lane_release() {
echo "== lane: release =="
"$CARGO" build --release --locked
"$ROOT/scripts/package-release.sh"
"$ROOT/scripts/verify-release.sh"
}
case "$LANE" in
test) lane_test ;;
minimum) lane_minimum ;;
core) lane_core ;;
release) lane_release ;;
all)
lane_test
if [ -n "${MARQDO_BIN:-}" ]; then lane_core; else echo "skip: core lane needs MARQDO_BIN"; fi
lane_release
;;
*) echo "usage: scripts/ci.sh test|minimum|core|release|all" >&2; exit 2 ;;
esac