Skip to content

Commit 370a3da

Browse files
committed
garotm - final cleanup before first release.
1 parent b96f18f commit 370a3da

3 files changed

Lines changed: 173 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,28 @@ jobs:
101101
if-no-files-found: warn
102102
retention-days: 30
103103

104+
# ── Extract changelog entry for this tag ────────────────────────────────
105+
- name: Extract changelog body
106+
if: startsWith(github.ref, 'refs/tags/')
107+
id: changelog
108+
shell: pwsh
109+
run: |
110+
$tag = "${{ github.ref_name }}" # e.g. v0.2.0
111+
$version = $tag.TrimStart('v') # e.g. 0.2.0
112+
$content = Get-Content CHANGELOG.md -Raw
113+
114+
# Match the section for this version: from "## [X.Y.Z]" to the next "## ["
115+
$pattern = "(?s)## \[$version\][^\n]*\n(.*?)(?=\n## \[|\z)"
116+
if ($content -match $pattern) {
117+
$body = $Matches[1].Trim()
118+
} else {
119+
$body = "See [CHANGELOG.md](https://github.com/fleXRPL/sift/blob/main/CHANGELOG.md) for details."
120+
}
121+
122+
# Write to a file to avoid multiline output quoting issues
123+
$body | Out-File -FilePath release-notes.txt -Encoding utf8
124+
Write-Host "Extracted release notes for $version"
125+
104126
# ── GitHub Release (tags only) ───────────────────────────────────────────
105127
- name: Create GitHub Release
106128
if: startsWith(github.ref, 'refs/tags/')
@@ -109,6 +131,6 @@ jobs:
109131
files: |
110132
src-tauri/target/release/bundle/nsis/*.exe
111133
src-tauri/target/release/bundle/msi/*.msi
112-
generate_release_notes: true
134+
body_path: release-notes.txt
113135
env:
114136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,75 @@ Full guides live in **[docs/](docs/README.md)**:
3939

4040
### Prerequisites
4141

42-
- [Rust](https://www.rust-lang.org/tools/install) (latest stable)
43-
- [Node.js](https://nodejs.org/) (v18+)
44-
- [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) (included on most Windows 10/11 systems)
42+
- [Rust](https://www.rust-lang.org/tools/install) (latest stable — run `rustup update stable`)
43+
- [Node.js](https://nodejs.org/) v18+
44+
- [Ollama](https://ollama.com/) running locally with a compatible model (e.g. `ollama run gemma4:26b`)
45+
- [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) (pre-installed on most Windows 10/11 systems)
4546

4647
### Clone, install, run
4748

4849
```bash
4950
git clone https://github.com/fleXRPL/sift.git
5051
cd sift
51-
npm install && npm install --prefix frontend && npm install --prefix backend
52-
npm run dev
52+
node sift.mjs deps # installs all npm dependencies (root + frontend + backend)
53+
node sift.mjs check # pre-flight: verifies Node, Rust, Ollama, and configured model
54+
node sift.mjs run # starts Tauri dev shell + Vite + backend in one command
5355
```
5456

55-
See [docs/QUICKSTART.md](docs/QUICKSTART.md) for a step-by-step checklist.
57+
See [docs/QUICKSTART.md](docs/QUICKSTART.md) for the full step-by-step checklist.
58+
59+
### `sift.mjs` CLI reference
60+
61+
| Command | What it does |
62+
| ------- | ------------ |
63+
| `node sift.mjs run` | Start the full dev stack (Tauri + Vite + backend) |
64+
| `node sift.mjs check` | Pre-flight check: Node, Rust, deps, Ollama, model |
65+
| `node sift.mjs deps` | Install all npm dependencies |
66+
| `node sift.mjs debug` | Start with verbose logging |
67+
| `node sift.mjs stop` | Kill all running dev processes |
68+
| `node sift.mjs package` | Bundle the backend into a Windows sidecar `.exe` |
5669

5770
### Tests and CI
5871

5972
```bash
60-
npm test
73+
npm test # run all backend + frontend tests
74+
npm test --prefix backend # backend only (Jest)
75+
npm test --prefix frontend # frontend only (Vitest)
6176
```
6277

63-
Continuous integration is defined in [`.github/workflows/ci.yml`](.github/workflows/ci.yml) (backend, frontend, Rust `cargo check`). Details: [docs/TESTING.md](docs/TESTING.md).
78+
Continuous integration runs on every push and PR via [`.github/workflows/ci.yml`](.github/workflows/ci.yml) — covers backend (Jest), frontend (Vitest + build), and Rust (`cargo check`). Details: [docs/TESTING.md](docs/TESTING.md).
79+
80+
### Creating a release
81+
82+
Push a version tag to trigger the automated Windows installer build:
83+
84+
```bash
85+
# 1. Bump version in tauri.conf.json, Cargo.toml, and package.json (keep in sync)
86+
git tag v0.2.0
87+
git push origin v0.2.0
88+
```
89+
90+
GitHub Actions builds a signed NSIS `.exe` installer on `windows-latest` and attaches it to a GitHub Release automatically. See [docs/BUILD-AND-RELEASE.md](docs/BUILD-AND-RELEASE.md) for full details, manual build steps, and code-signing setup.
6491

6592
---
6693

6794
## Project structure
6895

6996
```text
7097
sift/
71-
├── .github/ # GitHub Actions workflows
98+
├── .cursor/
99+
│ ├── rules/ # Cursor coding rules (TypeScript, Rust, security, testing)
100+
│ └── skills/ # On-demand healthcare skills (PHI, HIPAA, EMR, CDSS)
101+
├── .github/
102+
│ ├── workflows/ci.yml # CI: backend, frontend, cargo check
103+
│ └── workflows/release.yml # Release: Windows NSIS installer on version tag
72104
├── docs/ # Documentation (start at docs/README.md)
73105
├── frontend/ # Vite + React + Tailwind UI
74106
├── backend/ # Node orchestrator (Express, SQLite, ingest, LLM client)
75-
├── src-tauri/ # Tauri host: tray, folder watch → POST /api/ingest
76-
├── img/ # Brand assets (e.g. icon source for Tauri)
107+
├── src-tauri/ # Tauri host: tray, folder watch, sidecar lifecycle
108+
├── samples/ # Sample FHIR, HL7, and PDF files for manual testing
109+
├── img/ # Brand assets (icon source for Tauri)
110+
├── sift.mjs # Developer CLI (run / check / deps / debug / stop / package)
77111
└── data/ # Local SQLite (sift.db), created at runtime
78112
```
79113

@@ -88,7 +122,3 @@ See [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md). Testing strategy and CI expect
88122
## 📜 License
89123

90124
Distributed under the **MIT License**. See `LICENSE` for more information.
91-
92-
---
93-
94-
**Windows release:** build the Node sidecar with `npm run package --prefix backend` (requires `pkg`), place `llama-server` next to the app per `docs/Transform-Summary.md`, then add `externalBin` entries in `src-tauri/tauri.conf.json` before bundling.

docs/BUILD-AND-RELEASE.md

Lines changed: 105 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,28 +74,127 @@ src-tauri/target/release/bundle/nsis/Sift_<version>_x64-setup.exe
7474

7575
---
7676

77-
## GitHub Actions — automated Windows release
77+
## CI — `cargo check` and the sidecar stub
78+
79+
Tauri's build script validates that every `externalBin` entry exists on disk with the correct
80+
target-triple suffix before compiling — even during `cargo check`. Because the real backend
81+
binary is only produced in the release workflow (on Windows), CI would fail if it ran
82+
`cargo check` against an empty `binaries/` directory.
83+
84+
The `tauri-host` job in `ci.yml` works around this by creating a zero-byte stub before
85+
`cargo check` runs:
86+
87+
```yaml
88+
- name: Create sidecar stub for cargo check
89+
run: |
90+
mkdir -p src-tauri/binaries
91+
touch src-tauri/binaries/sift-backend-x86_64-unknown-linux-gnu
92+
chmod +x src-tauri/binaries/sift-backend-x86_64-unknown-linux-gnu
93+
```
7894
79-
Workflow: [`.github/workflows/release.yml`](../.github/workflows/release.yml)
95+
Tauri's build script only checks existence, not content, so the type-check passes cleanly.
96+
The real binary is built and verified only in `release.yml` on `windows-latest`.
97+
98+
---
99+
100+
## Release workflow
101+
102+
Sift uses a **release branch** pattern: all feature work lands on `main`, a
103+
dedicated `release/vX.Y.Z` branch is used to finalise the changelog and bump
104+
versions, that branch is PR'd back to `main`, and the tag is pushed only after
105+
the PR merges. This keeps the changelog reviewed and the tag pointing at a clean,
106+
deliberate commit.
107+
108+
### Step-by-step release process
109+
110+
#### 1. Finish feature work on `main`
111+
112+
Merge all feature PRs to `main` as normal. CI must be green before proceeding.
113+
114+
#### 2. Create a release branch
115+
116+
```bash
117+
git checkout main && git pull origin main
118+
git checkout -b release/v0.2.0
119+
```
120+
121+
#### 3. Bump versions (keep all three in sync)
122+
123+
| File | Field |
124+
| ---- | ----- |
125+
| `src-tauri/tauri.conf.json` | `"version"` |
126+
| `src-tauri/Cargo.toml` | `version` |
127+
| Root `package.json` | `"version"` |
128+
129+
#### 4. Update `CHANGELOG.md`
130+
131+
Move items from `## [Unreleased]` into a new versioned section:
80132

81-
### Triggering a release
133+
```markdown
134+
## [0.2.0] — YYYY-MM-DD
82135
83-
Push a version tag:
136+
### Added
137+
- …
138+
139+
### Fixed
140+
- …
141+
142+
### Changed
143+
- …
144+
```
145+
146+
Add the comparison link at the bottom:
147+
148+
```markdown
149+
[0.2.0]: https://github.com/fleXRPL/sift/compare/v0.1.0...v0.2.0
150+
```
151+
152+
Update the `[Unreleased]` link to point from the new tag:
153+
154+
```markdown
155+
[Unreleased]: https://github.com/fleXRPL/sift/compare/v0.2.0...HEAD
156+
```
157+
158+
#### 5. Commit and push the release branch
84159

85160
```bash
161+
git add CHANGELOG.md src-tauri/tauri.conf.json src-tauri/Cargo.toml package.json
162+
git commit -m "chore: release v0.2.0"
163+
git push origin release/v0.2.0
164+
```
165+
166+
#### 6. Open a PR: `release/v0.2.0 → main`
167+
168+
- Title: `chore: release v0.2.0`
169+
- Body: paste the new CHANGELOG section as context for reviewers
170+
- Wait for CI to pass, get approval, then **Squash and merge**
171+
172+
#### 7. Pull `main` locally and tag
173+
174+
```bash
175+
git checkout main && git pull origin main
86176
git tag v0.2.0
87177
git push origin v0.2.0
88178
```
89179

180+
Pushing the tag triggers `release.yml` automatically.
181+
182+
---
183+
184+
## GitHub Actions — automated Windows release
185+
186+
Workflow: [`.github/workflows/release.yml`](../.github/workflows/release.yml)
187+
90188
The `release.yml` workflow runs on `windows-latest` and:
91189

92190
1. Installs Node 18 + all npm deps
93191
2. Builds frontend (`vite build`)
94192
3. Bundles backend sidecar with `pkg` → `src-tauri/binaries/`
95193
4. Verifies the `.exe` exists and prints its size
96194
5. Runs `npx tauri build` (with `CI=false`)
97-
6. Uploads the NSIS `.exe` as a **GitHub Release asset** (auto-generated release notes)
98-
7. Also saves the installer as a workflow **artifact** (30-day retention) for non-tag builds
195+
6. Extracts the matching `CHANGELOG.md` section for the tag version
196+
7. Creates a **GitHub Release** with the changelog body and attaches the NSIS `.exe`
197+
8. Also saves the installer as a workflow **artifact** (30-day retention)
99198

100199
### Manual test build (no tag needed)
101200

0 commit comments

Comments
 (0)