Files
marqdo-knowledge/.github/workflows/ci.yml
T
marqdo-knowledge 835f61dc01 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
2026-11-26 09:05:27 +08:00

108 lines
3.6 KiB
YAML

name: CI
on:
push:
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CORE_REPO: https://github.com/cflmy/marqdo-cli
CORE_SHA: 4bbefc92449ee480c8a2c89b0308feb4cda8d0e7
jobs:
test:
name: fmt + clippy + workspace tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
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
minimum-rust:
name: MSRV check (1.89)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.89
- uses: Swatinem/rust-cache@v2
- run: cargo check --locked --workspace --all-targets
core-analysis:
name: real Analysis integration (pinned core CLI)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build pinned core CLI
run: |
set -eu
git clone --quiet "$CORE_REPO" /tmp/marqdo-cli
cd /tmp/marqdo-cli
git checkout --quiet "$CORE_SHA"
cargo build --release --locked -p marqdo-cli
- name: Run integration lane against the real binary
env:
MARQDO_TEST_BIN: /tmp/marqdo-cli/target/release/marqdo
run: |
/tmp/marqdo-cli/target/release/marqdo --version
cargo test --workspace --locked
- name: CLI smoke
run: cargo build --locked && target/debug/marqdo-knowledge --help >/dev/null
release:
name: beta release archive
if: startsWith(github.ref, 'refs/tags/')
needs: [test, minimum-rust, core-analysis]
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build pinned core CLI
run: |
set -eu
git clone --quiet "$CORE_REPO" /tmp/marqdo-cli
cd /tmp/marqdo-cli
git checkout --quiet "$CORE_SHA"
cargo build --release --locked -p marqdo-cli
- name: Deterministic package and cold-install smoke
env:
MARQDO_BIN: /tmp/marqdo-cli/target/release/marqdo
run: |
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:
name: marqdo-knowledge-beta
path: |
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:
prerelease: true
files: |
dist/*.tar.gz
dist/*.sha256
dist/RELEASE_INFO.json
dist/FILES.sha256
dist/smoke-evidence.json
body_path: docs/releases/0.1.0-beta.2.md