ci: publish Knowledge through a verified immutable draft
ci/woodpecker/pr/ci Pipeline is pending

This commit is contained in:
cflmy committed 2026-11-27 21:19:22 +08:00
1 parent a1a223f53f
commit c03a8d9d98
6 files changed
+406 -238

No files matched your search

+15 -1
View File
@@ -4,7 +4,9 @@
# released CLI/Bundle (`MARQDO_BIN`, `MARQDO_STDLIB_DIR` preset); the lane only
# runs this repository's own checks. No per-run rustup/apt/CLI download.
when:
event: [push, pull_request, manual]
- event: [pull_request, manual]
- event: push
branch: master
steps:
test:
@@ -16,8 +18,20 @@ steps:
MARQDO_TOOL_HOME: /tmp/marqdo-tool-home
commands:
- python3 tools/ci/test_release_metadata.py
- python3 tools/ci/test_publish_gitea.py
- cargo fmt --all -- --check
- cargo clippy --workspace --all-targets --locked -- -D warnings
- cargo test --workspace --locked
- cargo build --release --locked
- target/release/marqdo-knowledge --help
minimum-rust:
image: rust:1.89-bookworm
when:
- event: manual
- event: [push, pull_request]
path:
include: ['**/*.rs', '**/Cargo.toml', Cargo.lock, '.cargo/**', '.woodpecker/**']
on_empty: true
commands:
- cargo check --locked --workspace --all-targets
+4 -33
View File
@@ -1,10 +1,10 @@
# Woodpecker CI pipeline for marqdo-knowledge.
# Tag-only compatibility and release artifact validation for marqdo-knowledge.
#
# Mirrors the local lanes in scripts/ci.sh and the GitHub workflow. The core CLI
# is built from the pinned marqdo-cli commit because the Analysis contract is an
# external boundary; integration tests always run against that real binary.
when:
event: [push, pull_request, tag]
event: [tag]
steps:
test:
@@ -44,43 +44,14 @@ steps:
release:
depends_on: [test, minimum-rust, core-analysis]
when:
event: [tag]
image: rust:1.100-bookworm
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
image: git.cflmy.cn/cflmy/marqdo-ci-rust:3.0.0-rc.5
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates git build-essential python3
- |
set -eu
core_sha=4bbefc92449ee480c8a2c89b0308feb4cda8d0e7
work=$(mktemp -d)
git clone --quiet https://git.cflmy.cn/cflmy/marqdo-cli.git "$work/core"
( cd "$work/core" && git checkout --quiet "$core_sha" \
&& cargo build --release --locked -p marqdo-cli )
export MARQDO_BIN="$work/core/target/release/marqdo"
cargo build --release --locked
version="$(cargo metadata --no-deps --format-version 1 --offline \
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-knowledge"))')"
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
python3 tools/release/package.py --source-sha "$CI_COMMIT_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
if [ -z "${GITEA_TOKEN:-}" ]; then
echo "publish: skipped (this Woodpecker instance did not inject the GITEA_TOKEN secret); the deterministic archive and smoke evidence above are the CI evidence. Publish the prerelease locally from the same tagged SHA with tools/release/publish-gitea.py."
else
python3 tools/release/publish-gitea.py \
--tag "$CI_COMMIT_TAG" \
--archive "dist/marqdo-knowledge-$version-x86_64-unknown-linux-gnu.tar.gz" \
--files dist/RELEASE_INFO.json dist/FILES.sha256 dist/smoke-evidence.json \
--body-file "docs/releases/$version.md"
fi
- cat dist/RELEASE_INFO.json
- cat dist/*.tar.gz.sha256
- cat dist/smoke-evidence.json
- |
if [ -f dist/gitea-release-evidence.json ]; then
cat dist/gitea-release-evidence.json
else
echo "publish: skipped (no GITEA_TOKEN secret injection on this instance)"
fi