ci: align release tooling with the upstream deterministic pipeline

- add tools/release/package.py: sorted, commit-timestamped, uid/gid-normalised
  deterministic archive; refuses dirty trees, source-SHA mismatch and stale
  versions; emits SOURCE_SHA, FILES.sha256 and RELEASE_INFO.json with binaries,
  protocol revisions, core baseline and manifest digest
- add tools/release/smoke.py: verifies checksum/manifest/source/version then
  cold-installs the archive through a real core CLI into an isolated
  MARQDO_TOOL_HOME and exercises help/compile/query/check/remove, writing smoke
  evidence
- add tools/ci/test_release_metadata.py: single CI gate for version/fact
  consistency across Cargo files, tool.json, spec, CHANGELOG, release notes,
  README and CI configuration
- Woodpecker and GitHub pipelines now run the metadata gate and use the Python
  packager/smoke test in the tag-only release lane; shell release scripts are
  thin wrappers; docs/ci.md and docs/releasing.md document gates and non-gates
This commit is contained in:
marqdo-knowledge committed 2026-11-26 09:05:27 +08:00
1 parent 85458c1d93
commit 835f61dc01
13 files changed
+663 -122

No files matched your search

+12 -5
View File
@@ -20,6 +20,8 @@ jobs:
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Release metadata consistency
run: python3 tools/ci/test_release_metadata.py
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
- run: cargo test --workspace --locked
@@ -74,13 +76,14 @@ jobs:
cd /tmp/marqdo-cli
git checkout --quiet "$CORE_SHA"
cargo build --release --locked -p marqdo-cli
- name: Package and cold-install smoke
- name: Deterministic package and cold-install smoke
env:
MARQDO_BIN: /tmp/marqdo-cli/target/release/marqdo
SOURCE_SHA: ${{ github.sha }}
run: |
scripts/package-release.sh
scripts/verify-release.sh
version="$(python3 -c 'import re,pathlib;print(re.search(r"(?m)^version\s*=\s*\"([^\"]+)\"", pathlib.Path("Cargo.toml").read_text()).group(1))')"
python3 tools/release/package.py --source-sha "${{ github.sha }}" --version "$version"
python3 tools/release/smoke.py --archive "dist/marqdo-knowledge-$version-x86_64-unknown-linux-gnu.tar.gz" --evidence-out dist/smoke-evidence.json
cat dist/RELEASE_INFO.json dist/*.tar.gz.sha256 dist/smoke-evidence.json
- name: Upload release archive
uses: actions/upload-artifact@v4
with:
@@ -89,6 +92,8 @@ jobs:
dist/*.tar.gz
dist/*.sha256
dist/RELEASE_INFO.json
dist/FILES.sha256
dist/smoke-evidence.json
- name: Publish GitHub prerelease
uses: softprops/action-gh-release@v2
with:
@@ -97,4 +102,6 @@ jobs:
dist/*.tar.gz
dist/*.sha256
dist/RELEASE_INFO.json
body_path: docs/releases/0.1.0-beta.1.md
dist/FILES.sha256
dist/smoke-evidence.json
body_path: docs/releases/0.1.0-beta.2.md