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"