|
| 1 | +# 🧰 Build Scripts |
| 2 | + |
| 3 | +Helper scripts for local development and CI. |
| 4 | +Run from the **repo root** unless otherwise noted. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 📦 What’s Here |
| 9 | + |
| 10 | +- **`Dev-PackInstallSamples.ps1` / `.sh`** — Restore, build, and **pack** `KeelMatrix.QueryWatch*` libraries, then restore **samples** against the locally packed feed (`./artifacts/packages`). |
| 11 | + → `build/Dev-PackInstallSamples.ps1` • `build/Dev-PackInstallSamples.sh` |
| 12 | + |
| 13 | +- **`Dev-CleanPackInstallSamples.ps1` / `.sh`** — Same as above, but first **cleans** local `KeelMatrix.QueryWatch*.nupkg` / `.snupkg` before rebuilding & packing. Ideal when iterating locally. |
| 14 | + → `build/Dev-CleanPackInstallSamples.ps1` • `build/Dev-CleanPackInstallSamples.sh` |
| 15 | + |
| 16 | +- **`Update-ReadmeFlags.ps1`** — Builds the CLI and updates the README block between |
| 17 | + `<!-- BEGIN:CLI_FLAGS -->` and `<!-- END:CLI_FLAGS -->` using `--print-flags-md`. |
| 18 | + Writes fallback output to `docs/CLI_FLAGS.generated.md` if markers are missing. |
| 19 | + → `build/Update-ReadmeFlags.ps1` |
| 20 | + |
| 21 | +- **`Pack-Sign-Push.ps1`** — End-to-end **pack → (optional) sign → push** workflow. |
| 22 | + Stubs for signing/publishing (customize for your environment). |
| 23 | + → `build/Pack-Sign-Push.ps1` |
| 24 | + |
| 25 | +- **`New-DevSecrets.ps1`** — Stub that documents how to configure your **NuGet API key** and import a **code-signing certificate** locally. Safe to customize for your organization. |
| 26 | + → `build/New-DevSecrets.ps1` |
| 27 | + |
| 28 | +> PowerShell (`.ps1`) and Bash (`.sh`) variants are provided to support cross-platform workflows. |
| 29 | +
|
| 30 | +--- |
| 31 | + |
| 32 | +## ⚡ Quick Tasks |
| 33 | + |
| 34 | +### Pack libs and restore samples (fast path) |
| 35 | + |
| 36 | +#### Windows / PowerShell |
| 37 | +```powershell |
| 38 | +pwsh -NoProfile -File build/Dev-PackInstallSamples.ps1 |
| 39 | +``` |
| 40 | + |
| 41 | +#### Linux / macOS |
| 42 | +```bash |
| 43 | +bash build/Dev-PackInstallSamples.sh |
| 44 | +``` |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +### Clean old local packages, repack, restore samples |
| 49 | + |
| 50 | +```powershell |
| 51 | +pwsh -NoProfile -File build/Dev-CleanPackInstallSamples.ps1 |
| 52 | +``` |
| 53 | + |
| 54 | +```bash |
| 55 | +bash build/Dev-CleanPackInstallSamples.sh |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +### Refresh CLI flags in README |
| 61 | + |
| 62 | +```powershell |
| 63 | +./build/Update-ReadmeFlags.ps1 |
| 64 | +``` |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### End-to-end pack → (optional) sign → push |
| 69 | + |
| 70 | +Customize first, then run: |
| 71 | +```powershell |
| 72 | +./build/Pack-Sign-Push.ps1 |
| 73 | +``` |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## 🧩 Prerequisites |
| 78 | + |
| 79 | +- **.NET SDK 8.x+** → check via: |
| 80 | + ```bash |
| 81 | + dotnet --info |
| 82 | + ``` |
| 83 | + See: `docs/DEV.md` |
| 84 | +- For signing/publish flows: configure your **NuGet API key** and (optional) **code-signing certificate** locally. |
| 85 | + See: `build/New-DevSecrets.ps1` |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## 📁 Conventions |
| 90 | + |
| 91 | +- Artifacts are written to `./artifacts` (subfolders: `packages/`, `benchmarks/`, etc). |
| 92 | + See: `build/Dev-PackInstallSamples.ps1` or `bench/README.md`. |
| 93 | + |
| 94 | +--- |
0 commit comments