Reuse the frozen Linux archive for release smoke and artifact delivery

This commit is contained in:
cflmy committed 2026-11-22 22:11:34 +08:00
1 parent e4c4a852d0
commit 1390f0081b
5 files changed
+86 -83

No files matched your search

+28 -69
View File
@@ -185,7 +185,7 @@ jobs:
frozen-extensions:
name: frozen Linux archive and external extensions
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
@@ -200,6 +200,7 @@ jobs:
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-cli"))')"
python3 tools/release/package.py --source-sha "$GITHUB_SHA" --version "$version"
python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz
tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$GITHUB_SHA" dist/frozen-extension-evidence.json
- uses: actions/upload-artifact@v4
with:
@@ -207,6 +208,13 @@ jobs:
path: dist/frozen-extension-evidence.json
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
with:
name: frozen-linux-archive-${{ github.sha }}
path: dist/marqdo-*.tar.gz*
if-no-files-found: error
release-evidence:
name: release evidence manifest
needs: [test, schema, cross-platform, frozen-extensions]
@@ -222,7 +230,6 @@ jobs:
LINUX_RESULT: ${{ needs.test.result }}
SCHEMA_RESULT: ${{ needs.schema.result }}
EXTENSIONS_RESULT: ${{ needs.frozen-extensions.result }}
PORTABLE_RESULT: ${{ needs.cross-platform.result }}
run: |
set -euo pipefail
state() {
@@ -233,11 +240,18 @@ jobs:
esac
}
linux="$(state "$LINUX_RESULT")"
portable="$(state "$PORTABLE_RESULT")"
if [ "$(state "$SCHEMA_RESULT")" != "PASS" ] || [ "$(state "$EXTENSIONS_RESULT")" != "PASS" ]; then
linux="FAIL"
fi
python3 tools/ci/release_evidence.py --target-sha "$TARGET_SHA" --out "docs/evidence/ci/$TARGET_SHA/manifest.json" --gate "linux=$linux:$TARGET_SHA:$RUN_URL" --gate "windows=$portable:$TARGET_SHA:$RUN_URL" --gate "macos=$portable:$TARGET_SHA:$RUN_URL" --gate "strict_vm=UNVERIFIED::${{ github.server_url }}/${{ github.repository }}/actions/workflows/security-linux.yml" --gate "performance=UNVERIFIED::"
python3 tools/ci/release_evidence.py --profile rc --target-sha "$TARGET_SHA" \
--out "docs/evidence/ci/$TARGET_SHA/manifest.json" \
--gate "linux=$linux:$TARGET_SHA:$RUN_URL" \
--gate "windows=UNSUPPORTED:$TARGET_SHA:linux-only-rc-scope" \
--gate "macos=UNSUPPORTED:$TARGET_SHA:linux-only-rc-scope" \
--gate "extension=$(state "$EXTENSIONS_RESULT"):$TARGET_SHA:$RUN_URL" \
--gate "strict_vm=UNVERIFIED::$RUN_URL" \
--gate "performance=UNVERIFIED::$RUN_URL"
- name: Validate external-extension evidence when committed
shell: bash
env:
@@ -249,7 +263,7 @@ jobs:
python3 tools/ci/verify_extension_contracts.py --validate "$manifest"
else
echo "UNVERIFIED: no external-extension manifest for $TARGET_SHA."
echo "Release requires tools/ci/verify_extension_contracts.py on the tagged SHA (docs/releasing.md §7)."
echo "Release requires tools/ci/verify_extension_contracts.py on the tagged SHA (docs/releasing.md §8)."
fi
- name: Upload release manifest
uses: actions/upload-artifact@v4
@@ -259,72 +273,17 @@ jobs:
if-no-files-found: error
release-candidate:
name: release candidate artifact (${{ matrix.os }})
name: archive-only Linux candidate smoke
needs: [test, schema, cross-platform, frozen-extensions]
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build release binaries
run: |
cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
test -x target/release/marqdo-provider-worker
- name: Package and checksum
shell: bash
run: |
set -euo pipefail
version="$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json,sys; print(json.load(sys.stdin)["packages"][0]["version"])')"
stage="dist/marqdo-${version}-${{ matrix.target }}"
mkdir -p "$stage"
install -m 0755 target/release/marqdo "$stage/"
# The provider worker is required for provider.json v2 and must be a
# sibling of the marqdo executable (no PATH fallback).
install -m 0755 target/release/marqdo-provider-worker "$stage/"
cp LICENSE-MIT LICENSE-APACHE CHANGELOG.md COMPATIBILITY.md README.md "$stage/"
cp -r spec examples "$stage/"
mkdir -p "$stage/tests"
cp -r tests/consumers "$stage/tests/"
printf 'source_sha=%s\nversion=%s\ntarget=%s\n' "$GITHUB_SHA" "$version" "${{ matrix.target }}" > "$stage/SOURCE_SHA"
rustc -vV > "$stage/rustc-vV.txt"
tar -C dist -czf "dist/marqdo-${version}-${{ matrix.target }}.tar.gz" "$(basename "$stage")"
cd dist
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "marqdo-${version}-${{ matrix.target }}.tar.gz" > "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
else
shasum -a 256 "marqdo-${version}-${{ matrix.target }}.tar.gz" > "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
fi
cat "marqdo-${version}-${{ matrix.target }}.tar.gz.sha256"
- name: Clean-install smoke
shell: bash
run: |
set -euo pipefail
tmp="$(mktemp -d)"
cp dist/marqdo-*.tar.gz* "$tmp/"
cd "$tmp"
sha256sum -c marqdo-*.tar.gz.sha256 2>/dev/null || shasum -a 256 -c marqdo-*.tar.gz.sha256
tar -xzf marqdo-*.tar.gz
cd marqdo-*
./marqdo --version
./marqdo --help >/dev/null
test -x ./marqdo-provider-worker
./marqdo check examples/multi-module/index.mq.md --refs --emit analysis.json
./marqdo run examples/hello.mq.md
./marqdo run examples/multi-module/index.mq.md --trace-file trace.json
python3 tests/consumers/analysis_consumer.py analysis.json
python3 tests/consumers/trace_consumer.py analysis.json trace.json
python3 tests/consumers/validate_protocols.py analysis.json trace.json examples/tool-unknown-name/tool.json
- uses: actions/upload-artifact@v4
with:
name: marqdo-${{ matrix.target }}
path: dist/marqdo-*.tar.gz*
if-no-files-found: error
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: frozen-linux-archive-${{ github.sha }}
path: dist
- name: Cold install the checked archive
run: bash tools/release/cold-install.sh dist/marqdo-*.tar.gz "$GITHUB_SHA"
+1 -12
View File
@@ -158,18 +158,7 @@ The cold-install gate must run in a container that receives **only the archive
bytes** — no source directory, no `/build`, no Cargo — and extracts them itself:
```bash
docker run --rm -v "$PWD/dist:/dist:ro" ubuntu:24.04 sh -c '
set -eu
mkdir -p /opt/marqdo
tar -xzf /dist/marqdo-<version>-x86_64-unknown-linux-gnu.tar.gz -C /opt/marqdo
cd /opt/marqdo/marqdo-<version>-x86_64-unknown-linux-gnu
./marqdo --version
./marqdo --help >/dev/null
./marqdo run examples/hello.mq.md
./marqdo check examples/multi-module/index.mq.md --emit /tmp/analysis.json
./marqdo call examples/math-library-demo.mq.md main
./marqdo call examples/factorial.mq.md 阶乘 --arg n=5
'
bash tools/release/cold-install.sh dist/marqdo-*.tar.gz "$(git rev-parse HEAD)"
```
Run this on the same Linux x86_64 glibc baseline as the release support
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Exercise only the shipped Linux archive on the supported glibc baseline.
set -euo pipefail
if [[ $# != 2 || ! $2 =~ ^[a-f0-9]{40}$ ]]; then
echo "usage: $0 <archive.tar.gz> <source-sha>" >&2
exit 2
fi
archive="$(realpath "$1")"
source_sha="$2"
name="$(basename "$archive")"
if [[ ! $name =~ ^marqdo-(.+)-x86_64-unknown-linux-gnu\.tar\.gz$ ]]; then
echo "unexpected archive name: $name" >&2
exit 2
fi
version="${BASH_REMATCH[1]}"
(
cd "$(dirname "$archive")"
sha256sum --check --status "$name.sha256"
)
docker run --rm --network none --user 65534:65534 \
--mount "type=bind,source=$archive,target=/archive.tar.gz,readonly" \
ubuntu:24.04 sh -eu -c '
test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.39"
if command -v cargo; then
echo "unexpected Cargo binary in the runtime container" >&2
exit 1
fi
mkdir /tmp/marqdo
tar -xzf /archive.tar.gz -C /tmp/marqdo
cd "/tmp/marqdo/marqdo-$1-x86_64-unknown-linux-gnu"
test "$(cat SOURCE_SHA)" = "$2"
test "$(./marqdo --version)" = "marqdo $1"
./marqdo --help >/dev/null
test -x ./marqdo-provider-worker
./marqdo run examples/hello.mq.md | grep -F "你好,Marqdo"
./marqdo check examples/multi-module/index.mq.md --emit /tmp/analysis.json
./marqdo call examples/math-library-demo.mq.md main
test "$(./marqdo call examples/factorial.mq.md 阶乘 --arg n=5)" = 120
./marqdo run tests/consumers/fixtures/execution-events/basic.mq.md \
--event-stream jsonl >/tmp/events.jsonl
tail -n 1 /tmp/events.jsonl | grep -Eq "\"kind\"[[:space:]]*:[[:space:]]*\"run.completed\""
mv stdlib stdlib.hidden
if ./marqdo run examples/hello.mq.md >/tmp/missing-stdlib.log 2>&1; then
echo "run succeeded without the shipped stdlib" >&2
exit 1
fi
grep -E "stdlib|symbol\.unknown|打印" /tmp/missing-stdlib.log
' sh "$version" "$source_sha"
+2 -1
View File
@@ -16,7 +16,7 @@ Usage (from the repository root, after
python3 tools/release/package.py \
--source-sha "$(git rev-parse HEAD)" \
--version 3.0.0-beta.1
--version 3.0.0-rc.1
"""
from __future__ import annotations
@@ -266,6 +266,7 @@ def stage(stage_dir: Path, version: str, source_sha: str, target: str) -> dict:
"protocols": {
"analysis": 2,
"trace": 2,
"execution_events": 1,
"tool": 1,
"plugin_abi": "1.x",
"foreign_wire": 1,
+5 -1
View File
@@ -9,7 +9,7 @@ Provider v2 worker (positive, unauthorized and missing-helper fail-closed), and
strict mode when the host genuinely supports it.
Usage:
python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz
python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu.tar.gz
"""
from __future__ import annotations
@@ -302,6 +302,10 @@ def main(argv: list[str]) -> int:
]
if not events or events[0].get("kind") != "stream.opened":
fail("Execution Events stream does not start with stream.opened")
if events[0].get("payload", {}).get("producer", {}).get("version") != version:
fail("Execution Events producer.version does not match the product version")
if events[0].get("schema_version") != info["protocols"].get("execution_events"):
fail("Execution Events schema_version does not match RELEASE_INFO.json")
if events[-1].get("kind") != "run.completed":
fail("Execution Events stream has no successful terminal event")
validate_events = subprocess.run(