Embed lib/*.mq.md in binary; marqdo version --check; public writeback/subtask pages; restore /vscode-extension/ ignore. VSIX built from branch vscode-extension only (see doc/design/vscode-extension-commit.md). Co-authored-by: Cursor <cursoragent@cursor.com>
103 lines
3.7 KiB
YAML
103 lines
3.7 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 Node (VS Code extension)
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Build release
|
|
run: cargo build --release
|
|
|
|
- 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")
|
|
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"
|
|
$vsix = "marqdo-$ver.vsix"
|
|
Copy-Item target/release/marqdo.exe "dist/$exe"
|
|
$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
|
|
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
|
|
|
|
- name: Upload release assets
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
body: |
|
|
## Marqdo ${{ github.ref_name }}
|
|
|
|
### Highlights
|
|
- **Embedded stdlib** (v0.1.2+): `lib/*.mq.md` built into the binary
|
|
- **writeback** + **subtask** stdlibs
|
|
- **`marqdo version --check`**
|
|
- VSIX built from branch **`vscode-extension`** (not tracked on `main`)
|
|
|
|
### Downloads
|
|
|
|
| Asset | Contents |
|
|
|-------|----------|
|
|
| `marqdo-*-windows-msvc.exe` | CLI with **embedded** official stdlib |
|
|
| `marqdo-*-windows-msvc.zip` | `marqdo.exe` + `lib/` (optional disk override) |
|
|
| `marqdo-*-stdlib.zip` | `lib/` only |
|
|
| `marqdo-*.vsix` | VS Code / Cursor extension |
|
|
|
|
Extension workflow: [doc/design/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.VSIX }}
|
|
fail_on_unmatched_files: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|