fix: validate Windows extension packs with 7-Zip

This commit is contained in:
cflmy committed 2026-11-18 14:40:07 +08:00
1 parent afbb9f191c
commit 24959a0ba8
2 files changed
+19 -7

No files matched your search

+14 -2
View File
@@ -2,7 +2,15 @@
name: Extension Release name: Extension Release
on: on:
workflow_dispatch:
inputs:
version:
description: Extension version to validate
required: true
type: string
push: push:
branches:
- codex/ext-release-validation
tags: tags:
- "ext-v*" - "ext-v*"
@@ -14,6 +22,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF_NAME_OVERRIDE: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('ext-v{0}', inputs.version || '2.8.1') }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -35,8 +44,9 @@ jobs:
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
./target/release/marqdo.exe call skills/marqdo-release/packs.mq.md ci --effects plugin,fs.read,fs.write,environment.read --fs-root . --require-ok --json GITHUB_REF_NAME="$GITHUB_REF_NAME_OVERRIDE" ./target/release/marqdo.exe call skills/marqdo-release/packs.mq.md ci --effects plugin,fs.read,fs.write,environment.read --fs-root . --require-ok --json
- name: Attach source and Windows native packs without replacement - name: Attach source and Windows native packs without replacement
if: startsWith(github.ref, 'refs/tags/ext-v')
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
@@ -47,6 +57,7 @@ jobs:
needs: windows needs: windows
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF_NAME_OVERRIDE: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('ext-v{0}', inputs.version || '2.8.1') }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -63,6 +74,7 @@ jobs:
cargo build --release -p marqdo -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm -p marqdo_plugin_engineering cargo build --release -p marqdo -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm -p marqdo_plugin_engineering
bash scripts/build-web-plugin.sh bash scripts/build-web-plugin.sh
- name: Build and validate the runner's exact pack bytes - name: Build and validate the runner's exact pack bytes
run: target/release/marqdo call skills/marqdo-release/packs.mq.md ci --effects plugin,fs.read,fs.write,environment.read --fs-root . --require-ok --json run: GITHUB_REF_NAME="$GITHUB_REF_NAME_OVERRIDE" target/release/marqdo call skills/marqdo-release/packs.mq.md ci --effects plugin,fs.read,fs.write,environment.read --fs-root . --require-ok --json
- name: Attach Linux native pack without replacement - name: Attach Linux native pack without replacement
if: startsWith(github.ref, 'refs/tags/ext-v')
run: target/release/marqdo call skills/marqdo-release/packs.mq.md attach_ci --effects plugin,fs.read,environment.read --fs-root . --require-ok --json run: target/release/marqdo call skills/marqdo-release/packs.mq.md attach_ci --effects plugin,fs.read,environment.read --fs-root . --require-ok --json
+5 -5
View File
@@ -15,7 +15,7 @@ import:
This leaf builds source and one platform's native extension archives for an authorized version. It does not publish, choose a version, create a tag or edit version files. The extension-release workflow runs the same tasks on Windows and Linux after local.tag pushes ext-vX.Y.Z. Its attach_ci task creates the exact tagged release through the native service boundary and attaches three assets with the existing gh upload tool; assets.publish subsequently verifies those exact bytes before R2 publication. This leaf builds source and one platform's native extension archives for an authorized version. It does not publish, choose a version, create a tag or edit version files. The extension-release workflow runs the same tasks on Windows and Linux after local.tag pushes ext-vX.Y.Z. Its attach_ci task creates the exact tagged release through the native service boundary and attaches three assets with the existing gh upload tool; assets.publish subsequently verifies those exact bytes before R2 publication.
Build all six maintained native plugins first. The native_dir contract is a directory containing their platform library names, normally target/release. Source discovery and staging use native Marqdo filesystem operations. Only ZIP encoding uses the existing platform tool: Info-ZIP on Linux, the installed bsdtar on Windows. Compiler and format boundaries do not require Python or a generated shell program. Build all six maintained native plugins first. The native_dir contract is a directory containing their platform library names, normally target/release. Source discovery and staging use native Marqdo filesystem operations. Only ZIP encoding uses the existing platform tool: Info-ZIP on Linux, 7-Zip on Windows. Compiler and format boundaries do not require Python or a generated shell program.
## libraries ## libraries
@@ -74,7 +74,7 @@ Return *[Reject an unsupported native target](result.error(code="packs.platform"
Use `stage`, `entry`, `output` and `platform` only after build preflight. Native resolution validates the stage and output paths first; the encoder receives individual arguments and one named staging subtree. It cannot expand a generated shell expression. A failed encoder can leave the selected incomplete archive for inspection; this task never reuses it as successful output or deletes unrelated files. Use `stage`, `entry`, `output` and `platform` only after build preflight. Native resolution validates the stage and output paths first; the encoder receives individual arguments and one named staging subtree. It cannot expand a generated shell expression. A failed encoder can leave the selected incomplete archive for inspection; this task never reuses it as successful output or deletes unrelated files.
The Windows runner supplies bsdtar with ZIP format support; Linux supplies Info-ZIP. Format encoding is the only external operation here. Reads, directory creation, copies, hashes and final ZIP validation remain separate explicit native tasks. The caller removes only its owned temporary stage after the child exits. Existing archives require inspection or a different output directory, keeping reruns from silently replacing publication candidates. The Windows runner supplies 7-Zip with ZIP format support; Linux supplies Info-ZIP. Format encoding is the only external operation here. Reads, directory creation, copies, hashes and final ZIP validation remain separate explicit native tasks. The caller removes only its owned temporary stage after the child exits. Existing archives require inspection or a different output directory, keeping reruns from silently replacing publication candidates.
1. [This output already belongs to an earlier attempt](fs.exists(path=`output`)) 1. [This output already belongs to an earlier attempt](fs.exists(path=`output`))
Return *[Preserve the existing archive](result.error(code="packs.output_exists", message=`output`, operation="_archive"))*. Return *[Preserve the existing archive](result.error(code="packs.output_exists", message=`output`, operation="_archive"))*.
@@ -96,9 +96,9 @@ We **destination = [Resolve the new archive inside the granted root](fs.resolve(
| argument | | argument |
|---| |---|
| "C:\\Windows\\System32\\tar.exe" | | "C:\\Program Files\\7-Zip\\7z.exe" |
| "--format=zip" | | a |
| "-cf" | | "-tzip" |
| `destination` | | `destination` |
| `entry` | | `entry` |