Files
marqdo-knowledge/.woodpecker/main.yml
T
marqdo-knowledge 155d40393c ci: publish the beta prerelease to Gitea from the tag lane
- fetch the pinned core CLI from git.cflmy.cn in Woodpecker instead of relying
  on GitHub access from the internal runner
- add tools/release/publish-gitea.py: idempotent create/update of the
  prerelease for the tag and upload of archive, checksum, FILES.sha256,
  RELEASE_INFO.json and smoke evidence; token only from the environment
- the tag-only Woodpecker lane now publishes through that script and fails
  closed when the GITEA_TOKEN repo secret is missing
2026-11-26 09:11:34 +08:00

78 lines
3.2 KiB
YAML

# Woodpecker CI pipeline 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]
steps:
test:
image: rust:1.100-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates python3
- rustup component add clippy rustfmt
- python3 tools/ci/test_release_metadata.py
- cargo fmt --all -- --check
- cargo clippy --workspace --all-targets --locked -- -D warnings
- cargo test --workspace --locked
minimum-rust:
image: rust:1.89-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates build-essential
- cargo check --locked --workspace --all-targets
core-analysis:
image: rust:1.100-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates git build-essential
- |
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 )
MARQDO_TEST_BIN="$work/core/target/release/marqdo" \
cargo test --workspace --locked
- cargo build --locked
- target/debug/marqdo-knowledge --help >/dev/null
release:
depends_on: [test, minimum-rust, core-analysis]
when:
event: [tag]
image: rust:1.100-bookworm
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"
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"))')"
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 "GITEA_TOKEN secret is required for the release lane" >&2
exit 2
fi
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"
- cat dist/RELEASE_INFO.json
- cat dist/*.tar.gz.sha256
- cat dist/smoke-evidence.json
- cat dist/gitea-release-evidence.json