@ondeinference / ed Mirror · read-only
Fork 0

Read-only mirror of github.com/ondeinference/ed.

Mirrored from https://github.com/ondeinference/ed.git

Synced Nov 23, 02:15 UTC

development
md 202 lines 7.54 KB
Rendered Raw
1 ---
2 name: release
3 description: Cut a release of the onde-ed Rust workspace. Covers version bumping, the release branch/PR flow, tagging, and the two tag-triggered GitHub Actions (crates.io publish and Swift XCFramework). Use when asked to create, cut, or publish a release.
4 allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5 user-invocable: true
6 ---
7
8 # Skill: Release
9
10 ## What This Skill Covers
11
12 How to cut a release of the `onde-ed` Cargo workspace: bumping the version,
13 landing it through the branch/PR flow, tagging, and what the two tag-triggered
14 workflows do automatically afterwards.
15
16 ## The one-number rule
17
18 The whole workspace releases on **one version**. Every crate declares
19 `version.workspace = true`, so a release changes exactly one source of truth:
20 the root `Cargo.toml`.
21
22 ```toml
23 [workspace.package]
24 version = "X.Y.Z"
25 ```
26
27 Plus the internal path dependencies in the same file, which pin the version
28 explicitly:
29
30 ```toml
31 ed-agent = { version = "X.Y.Z", path = "crates/ed-agent" }
32 ed-mcp = { version = "X.Y.Z", path = "crates/ed-mcp" }
33 ed-acp = { version = "X.Y.Z", path = "crates/ed-acp" }
34 ed-acp-tauri = { version = "X.Y.Z", path = "crates/ed-acp-tauri" }
35 ed-acp-tui = { version = "X.Y.Z", path = "crates/ed-acp-tui" }
36 ed-acp-testkit = { version = "X.Y.Z", path = "crates/ed-acp-testkit" }
37 ed-onde-account = { version = "X.Y.Z", path = "crates/ed-onde-account" }
38 ed-claude = { version = "X.Y.Z", path = "crates/ed-claude" }
39 ```
40
41 Bump all of these together. The crate manifests under `crates/*/Cargo.toml`
42 need no edits.
43
44 ## Versioning
45
46 Semver. Given the current `X.Y.Z`:
47 - **patch** (`Z+1`) — bug fixes, internal changes, no API additions.
48 - **minor** (`Y+1`, `Z=0`) — backwards-compatible API additions.
49 - **major** (`X+1`, `Y=Z=0`) — breaking changes.
50
51 ## Step-by-step
52
53 The base branch is **`development`**; `main` is the promoted/stable branch.
54 Releases land on `development` first, get tagged, then `development` is promoted
55 to `main`.
56
57 ### 1. Branch off `development`
58
59 ```sh
60 git checkout development && git pull
61 git checkout -b release/X.Y.Z
62 ```
63
64 ### 2. Bump the version
65
66 Edit the root `Cargo.toml` (`[workspace.package] version` and the internal
67 `ed-*` path-dependency versions). A quick way, run from the repo root:
68
69 ```sh
70 sed -i '' 's/OLD\.VER\.SION/X.Y.Z/g' Cargo.toml
71 ```
72
73 ### 3. Refresh the lockfile and verify
74
75 ```sh
76 cargo check --workspace # updates Cargo.lock, catches breakage
77 ```
78
79 `cargo fmt --all -- --check`, `cargo test --locked --workspace`, and
80 `cargo clippy --locked --workspace --all-targets -- -D warnings` must all pass —
81 the release workflow re-runs them and fails the publish otherwise.
82
83 ### 4. Commit and push
84
85 ```sh
86 git add Cargo.toml Cargo.lock
87 git commit -m "Release X.Y.Z: bump the workspace"
88 git push
89 ```
90
91 Commit subject convention: `Release X.Y.Z: bump the workspace`.
92
93 ### 5. Open the release PR → `development`
94
95 ```sh
96 gh pr create --base development --head release/X.Y.Z \
97 --title "Release X.Y.Z" --body "..."
98 gh pr edit <n> --add-assignee <you> --add-reviewer <reviewer>
99 ```
100
101 ### 6. Merge, then tag the merge commit
102
103 After approval, merge the PR, update local `development`, and tag **the merge
104 commit** (this is what every historical release tag points at):
105
106 ```sh
107 gh pr merge <n> --merge
108 git checkout development && git pull
109 git tag vX.Y.Z <merge-sha>
110 git push origin vX.Y.Z
111 ```
112
113 > The tag name carries a `v` prefix (`vX.Y.Z`); the workspace version does not
114 > (`X.Y.Z`). The workflows strip the `v` when comparing, so they must match on
115 > the numeric part.
116
117 ### 7. Promote `development` → `main`
118
119 Open a second PR to bring `main` up to the tagged state:
120
121 ```sh
122 gh pr create --base main --head development --title "Merge development → main (vX.Y.Z)"
123 ```
124
125 Merging it runs `ci.yml` on `main` as a final green check.
126
127 ## What the tag triggers
128
129 Pushing a `vX.Y.Z` tag fires **two** workflows. Both start with a `preflight`
130 job that validates the tag matches the `ed-agent` version in `Cargo.toml`, then
131 runs fmt + test + clippy. If the version and tag disagree, the release fails
132 here — this is the safety net for step 6.
133
134 ### `release-sdk-rust.yml` → crates.io
135
136 - Dry-runs the workspace publish with `cargo-workspaces` (plain
137 `cargo publish --dry-run` can't resolve the inter-crate path deps post-package).
138 - Publishes crates in dependency order to crates.io.
139 - `cargo workspaces plan --skip-published` makes re-runs safe: a run that dies
140 mid-publish only publishes the crates still missing from the registry.
141 - Workspace-member dev-deps must be path-only (`foo = { path = "../foo" }`), not
142 `foo.workspace = true`. cargo-workspaces strips dev-deps that carry a version,
143 which changes `Cargo.lock` and fails the `--locked` publish (ed-claude 1.4.0).
144 - The trusted-publishing token is short-lived. In v1.5.0 it expired after four
145 of the eight crates and the rest got `403 Invalid authentication token`, but
146 cargo-workspaces 0.4.2 still exited 0. A final step now checks every planned
147 crate against the crates.io index and fails the job if one is missing. Fix a
148 failed run by dispatching the workflow again on the same tag (see below).
149
150 ### `release-sdk-swift.yml` → XCFramework + `ed-swift`
151
152 - Builds the `EdFramework.xcframework` for Apple targets (~2h20m build;
153 **not** cancel-in-progress — killing it leaves half-published state).
154 - Creates a GitHub Release with the xcframework zip + checksum as assets.
155 - Checks out `ondeinference/ed-swift`, rewrites `Package.swift` with the new
156 release URL + checksum, copies the generated `ed_agent_ffi.swift`, commits,
157 pushes to `ed-swift` `main`, and tags it `vX.Y.Z`.
158
159 ## Adding a new crate
160
161 crates.io only allows a trusted publisher on a crate that already exists
162 (RFC 3691), so a new crate's first version goes up by hand, before the tag that
163 would publish it:
164
165 1. Create a token with scope `publish-new` only, crate pattern set to the new
166 crate, expiry 1 day. Keep it in `CARGO_REGISTRY_TOKEN` for one command; never
167 write it to `~/.cargo/credentials.toml`.
168 2. Publish the first version. If the crate needs an API that the last published
169 `ed-acp` lacks, it won't compile against the registry, so publish a
170 placeholder `0.0.1` (empty `lib.rs`, same license and metadata) from a
171 scratch directory. A caret requirement such as `"1.4"` never selects it.
172 3. Revoke the token.
173 4. On the crate's Settings → Trusted Publishing, add a GitHub publisher: owner
174 `ondeinference`, repository `ed`, workflow `release-sdk-rust.yml`, and the
175 same environment as `ed-acp`. Check the owners match `ed-acp`'s.
176 5. Tag as usual. The real crate then publishes through OIDC.
177
178 ## Manual / recovery runs
179
180 Both workflows have a `workflow_dispatch` with a `publish` boolean and a
181 `release_tag` input. Use this to re-publish an existing tag if a run failed
182 after tagging — e.g. the crates.io publish succeeded but the Swift build timed
183 out. Point it at the existing `vX.Y.Z` tag; the crates.io re-run skips anything
184 already on the registry.
185
186 ## Toolchain
187
188 The Rust toolchain is pinned in `rust-toolchain.toml` (currently `1.94.0`).
189 Workflows read `channel` from it, so a toolchain bump is a normal source change,
190 not release-time config.
191
192 ## Checklist
193
194 - [ ] On a `release/X.Y.Z` branch off `development`.
195 - [ ] Root `Cargo.toml`: `[workspace.package] version` + all `ed-*` path deps bumped.
196 - [ ] `cargo check --workspace` run (Cargo.lock updated).
197 - [ ] fmt / test / clippy all green locally.
198 - [ ] Commit `Release X.Y.Z: bump the workspace`.
199 - [ ] PR → `development`, reviewed, merged.
200 - [ ] `vX.Y.Z` tag on the merge commit, pushed.
201 - [ ] `development` → `main` PR opened/merged.
202 - [ ] Both tag workflows green (crates.io + Swift).