230 lines
10 KiB
YAML
230 lines
10 KiB
YAML
# Build and attach release binaries when a version tag is pushed.
|
||
name: Release
|
||
|
||
on:
|
||
push:
|
||
tags:
|
||
- "v*"
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
windows:
|
||
runs-on: windows-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
- name: Install Rust
|
||
uses: dtolnay/rust-toolchain@stable
|
||
|
||
- name: Install Go (web plugin)
|
||
uses: actions/setup-go@v5
|
||
with:
|
||
go-version: "1.23.x"
|
||
|
||
- name: Install Node (VS Code extension)
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "20"
|
||
|
||
- name: Install MinGW for cgo (web.dll)
|
||
run: choco install mingw -y
|
||
|
||
- name: Build release CLI + official plugins
|
||
shell: bash
|
||
run: |
|
||
export PATH="/c/ProgramData/mingw64/mingw64/bin:/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH"
|
||
cargo build --release
|
||
cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm
|
||
bash ./scripts/build-web-plugin.sh
|
||
|
||
- name: Checkout extension sources (branch vscode-extension only)
|
||
run: git fetch origin vscode-extension && git checkout origin/vscode-extension -- vscode-extension
|
||
|
||
- name: Build VSIX
|
||
shell: pwsh
|
||
run: |
|
||
$ver = "${{ github.ref_name }}".TrimStart("v")
|
||
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
||
Push-Location vscode-extension
|
||
npm ci
|
||
npm run compile
|
||
npx @vscode/vsce package --no-dependencies -o "../dist/marqdo-$ver.vsix"
|
||
Pop-Location
|
||
|
||
- name: Package
|
||
shell: pwsh
|
||
run: |
|
||
$ver = "${{ github.ref_name }}".TrimStart("v")
|
||
$target = "x86_64-pc-windows-msvc"
|
||
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
||
$exe = "marqdo-$ver-$target.exe"
|
||
$zip = "marqdo-$ver-$target.zip"
|
||
$stdlib = "marqdo-$ver-stdlib.zip"
|
||
$source = "marqdo-$ver-source.zip"
|
||
$vsix = "marqdo-$ver.vsix"
|
||
$public = "marqdo-$ver-public.zip"
|
||
$extZip = "marqdo-$ver-ext.zip"
|
||
$nativeZip = "marqdo-$ver-native-$target.zip"
|
||
Copy-Item target/release/marqdo.exe "dist/$exe"
|
||
git archive --format=zip -o "dist/$source" HEAD
|
||
./target/release/marqdo view output public -o public
|
||
Compress-Archive -Path public/* -DestinationPath "dist/$public" -Force
|
||
$stageExt = "dist/stage-ext"
|
||
if (Test-Path $stageExt) { Remove-Item $stageExt -Recurse -Force }
|
||
New-Item -ItemType Directory -Force -Path $stageExt | Out-Null
|
||
Copy-Item ext "$stageExt/ext" -Recurse
|
||
if (Test-Path "dist/$extZip") { Remove-Item "dist/$extZip" -Force }
|
||
Compress-Archive -Path "$stageExt/*" -DestinationPath "dist/$extZip" -Force
|
||
# Prebuilt native plugins (no Rust required for `marqdo ext add`)
|
||
$stageNative = "dist/stage-native"
|
||
if (Test-Path $stageNative) { Remove-Item $stageNative -Recurse -Force }
|
||
New-Item -ItemType Directory -Force -Path "$stageNative/native" | Out-Null
|
||
Copy-Item target/release/web.dll "$stageNative/native/web.dll"
|
||
Copy-Item target/release/agent.dll "$stageNative/native/agent.dll"
|
||
Copy-Item target/release/quantum.dll "$stageNative/native/quantum.dll"
|
||
Copy-Item target/release/linalg.dll "$stageNative/native/linalg.dll"
|
||
Copy-Item target/release/llm.dll "$stageNative/native/llm.dll"
|
||
if (Test-Path "dist/$nativeZip") { Remove-Item "dist/$nativeZip" -Force }
|
||
Compress-Archive -Path "$stageNative/*" -DestinationPath "dist/$nativeZip" -Force
|
||
$stage = "dist/stage-bundle"
|
||
if (Test-Path $stage) { Remove-Item $stage -Recurse -Force }
|
||
New-Item -ItemType Directory -Force -Path $stage | Out-Null
|
||
Copy-Item target/release/marqdo.exe "$stage/marqdo.exe"
|
||
Copy-Item lib "$stage/lib" -Recurse
|
||
Copy-Item ext "$stage/ext" -Recurse
|
||
New-Item -ItemType Directory -Force -Path "$stage/ext/native" | Out-Null
|
||
Copy-Item target/release/web.dll "$stage/ext/native/web.dll"
|
||
Copy-Item target/release/agent.dll "$stage/ext/native/agent.dll"
|
||
Copy-Item target/release/quantum.dll "$stage/ext/native/quantum.dll"
|
||
Copy-Item target/release/linalg.dll "$stage/ext/native/linalg.dll"
|
||
Copy-Item target/release/llm.dll "$stage/ext/native/llm.dll"
|
||
if (Test-Path "dist/$zip") { Remove-Item "dist/$zip" -Force }
|
||
Compress-Archive -Path "$stage/*" -DestinationPath "dist/$zip" -Force
|
||
$stageLib = "dist/stage-stdlib"
|
||
if (Test-Path $stageLib) { Remove-Item $stageLib -Recurse -Force }
|
||
New-Item -ItemType Directory -Force -Path $stageLib | Out-Null
|
||
Copy-Item lib "$stageLib/lib" -Recurse
|
||
if (Test-Path "dist/$stdlib") { Remove-Item "dist/$stdlib" -Force }
|
||
Compress-Archive -Path "$stageLib/*" -DestinationPath "dist/$stdlib" -Force
|
||
echo "EXE=$exe" >> $env:GITHUB_ENV
|
||
echo "ZIP=$zip" >> $env:GITHUB_ENV
|
||
echo "STDLIB=$stdlib" >> $env:GITHUB_ENV
|
||
echo "VSIX=$vsix" >> $env:GITHUB_ENV
|
||
echo "SOURCE=$source" >> $env:GITHUB_ENV
|
||
echo "PUBLIC=$public" >> $env:GITHUB_ENV
|
||
echo "EXT=$extZip" >> $env:GITHUB_ENV
|
||
echo "NATIVE=$nativeZip" >> $env:GITHUB_ENV
|
||
|
||
- name: Upload release assets
|
||
uses: softprops/action-gh-release@v2
|
||
with:
|
||
body: |
|
||
## Marqdo ${{ github.ref_name }}
|
||
|
||
### 亮点 / Highlights
|
||
- **2.6.0**:标准库与拓展库成为可执行手册;650 个公开标准库函数,标题下契约、叙述形参与句中调用。
|
||
- **2.6.0**: Executable library handbooks, 650 public standard-library functions, inline actions and source contracts.
|
||
- 文件/字节/集合/Result/文档/HTTP/任务/TOML/时区工程能力;Quantum 实验与 Web 递归 Markdown 布局。
|
||
- File, binary, collection, document and task workflows; executable Quantum experiments and recursive Web layouts.
|
||
- View 正文读动作,左右侧注看逻辑;空逻辑明确提示;知识区按输入、返回和依据组织。
|
||
- View keeps action text in prose, implementation in margin notes, and readable knowledge facts separate from execution.
|
||
- CLI · wasm · ext · VS Code extension: **2.6.0**. Core surface unchanged: **19 constructs**.
|
||
- Linux CLI and native plugin zips are required; see CHANGELOG for exact platform/effect boundaries.
|
||
|
||
### Downloads
|
||
|
||
| Asset | Contents |
|
||
|-------|----------|
|
||
| `marqdo-*-windows-msvc.exe` | CLI with **embedded** official stdlib |
|
||
| `marqdo-*-windows-msvc.zip` | `marqdo.exe` + `lib/` + `ext/`(含 native DLL) |
|
||
| `marqdo-*-native-*.zip` | 预编译 `web`/`agent`/`quantum`/`linalg`/`llm`(Windows DLL + **Linux .so 必出**) |
|
||
| `marqdo-*-unknown-linux-gnu.zip` | Linux CLI + `lib/` + `ext/` + native `.so` |
|
||
| `marqdo-*-stdlib.zip` | `lib/` only |
|
||
| `marqdo-*-ext.zip` | Official `ext/` L1 sources |
|
||
| `marqdo-*-source.zip` | Source snapshot (`git archive`) |
|
||
| `marqdo-*.vsix` | VS Code / Cursor extension |
|
||
| `marqdo-*-public.zip` | Static user docs site |
|
||
|
||
Extension workflow: [vscode-extension-commit.md](https://github.com/cflmy/marqdo/blob/main/doc/design/vscode-extension-commit.md)
|
||
files: |
|
||
dist/${{ env.EXE }}
|
||
dist/${{ env.ZIP }}
|
||
dist/${{ env.STDLIB }}
|
||
dist/${{ env.EXT }}
|
||
dist/${{ env.NATIVE }}
|
||
dist/${{ env.VSIX }}
|
||
dist/${{ env.SOURCE }}
|
||
dist/${{ env.PUBLIC }}
|
||
fail_on_unmatched_files: true
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
linux:
|
||
runs-on: ubuntu-latest
|
||
# Wait until Windows has created the GitHub Release, then attach Linux zips
|
||
# (required: native plugins for `marqdo ext add` on Linux + CLI bundle).
|
||
needs: windows
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Install Rust
|
||
uses: dtolnay/rust-toolchain@stable
|
||
|
||
- name: Install Go (web plugin)
|
||
uses: actions/setup-go@v5
|
||
with:
|
||
go-version: "1.23.x"
|
||
|
||
- name: Install zip + cgo toolchain
|
||
run: sudo apt-get update && sudo apt-get install -y zip gcc libc6-dev
|
||
|
||
- name: Build Linux CLI + official plugins
|
||
run: |
|
||
set -euo pipefail
|
||
cargo build --release
|
||
cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm
|
||
bash ./scripts/build-web-plugin.sh
|
||
|
||
- name: Package Linux native zip + CLI bundle
|
||
run: |
|
||
set -euo pipefail
|
||
VER="${GITHUB_REF_NAME#v}"
|
||
TARGET="x86_64-unknown-linux-gnu"
|
||
mkdir -p dist/stage-native/native
|
||
for lib in libweb.so libagent.so libquantum.so liblinalg.so libllm.so; do
|
||
src="target/release/${lib}"
|
||
if [[ ! -f "$src" && "$lib" == libweb.so ]]; then
|
||
src="plugins/web/build/libweb.so"
|
||
fi
|
||
test -f "$src" || { echo "missing $src" >&2; exit 1; }
|
||
cp "$src" "dist/stage-native/native/${lib}"
|
||
done
|
||
(cd dist/stage-native && zip -r "../marqdo-${VER}-native-${TARGET}.zip" .)
|
||
echo "NATIVE=marqdo-${VER}-native-${TARGET}.zip" >> "$GITHUB_ENV"
|
||
|
||
stage="dist/stage-linux"
|
||
rm -rf "$stage"
|
||
mkdir -p "$stage/ext/native" "$stage/lib"
|
||
cp target/release/marqdo "$stage/marqdo"
|
||
chmod +x "$stage/marqdo"
|
||
cp -a lib/. "$stage/lib/"
|
||
cp -a ext/. "$stage/ext/"
|
||
cp dist/stage-native/native/*.so "$stage/ext/native/"
|
||
linux_zip="marqdo-${VER}-${TARGET}.zip"
|
||
(cd "$stage" && zip -r "../${linux_zip}" .)
|
||
echo "LINUX_ZIP=${linux_zip}" >> "$GITHUB_ENV"
|
||
|
||
- name: Upload Linux packages
|
||
uses: softprops/action-gh-release@v2
|
||
with:
|
||
files: |
|
||
dist/${{ env.NATIVE }}
|
||
dist/${{ env.LINUX_ZIP }}
|
||
fail_on_unmatched_files: true
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|