40
| 8 | `sdk/dart/rust/Cargo.lock` | `onde` package version | Run `cd sdk/dart/rust && cargo update -p onde` |
41
| 9 | `sdk/react-native/rust/Cargo.lock` | `onde` package version | Run `cd sdk/react-native/rust && cargo update -p onde` |
42
| 10 | `Cargo.lock` (root) | `onde` package version | Run `cargo check` at repo root |
43
+| 11 | `CHANGELOG.md` (root) | New `## 0.1.3` section | Prepend at top of file. Missed for every 1.2.x release, which is why the file jumps from 1.1.1 to 1.2.5 |
44
45
### Files you do NOT manually edit
46
59
# 5. Edit sdk/react-native/rust/Cargo.toml version (manual)
60
# 6. Prepend new section to sdk/react-native/CHANGELOG.md (manual)
61
# 7. Edit sdk/kotlin/gradle.properties VERSION_NAME (manual)
62
+# 8. Prepend new section to CHANGELOG.md at the repo root (manual)
63
62
-# 8. Sync lockfiles
64
+# 9. Sync lockfiles
65
cargo check # updates root Cargo.lock
66
cd sdk/dart/rust && cargo update -p onde # updates Dart SDK's Cargo.lock
67
cd sdk/react-native/rust && cargo update -p onde # updates React Native SDK's Cargo.lock
68
67
-# 9. Verify
69
+# 10. Verify
70
grep '^version' Cargo.toml # "0.1.3"
71
grep '^version:' sdk/dart/pubspec.yaml # 0.1.3
72
grep '"version"' sdk/react-native/package.json # "0.1.3"
76
grep 'name = "onde"' -A1 sdk/dart/rust/Cargo.lock # version = "0.1.3"
77
grep 'name = "onde"' -A1 sdk/react-native/rust/Cargo.lock # version = "0.1.3"
78
77
-# 10. Commit and tag
79
+# 11. Commit and tag
80
git add -A
81
git commit -m "0.1.3"
82
git tag 0.1.3
245
version already exists, it **skips** with a success exit code. This makes the npm
246
workflow safe to re-run — unlike Dart/Rust, it won't fail on a duplicate version.
247
246
-### Required secret
248
+### No secret: trusted publishing
249
+
250
+Since 1.2.5 the npm workflow publishes over OIDC rather than a long-lived token,
251
+so there is no `NPM_TOKEN` to rotate. Two things have to line up instead:
252
+
253
+- The `publish` job declares `permissions: id-token: write`.
254
+- The trusted publisher on
255
+ npmjs.com/package/@ondeinference/react-native/access names repo
256
+ `ondeinference/onde`, workflow `release-sdk-npm.yml`, and no environment.
257
+
258
+If those drift apart, npm answers the publish with a 404 on PUT rather than an
259
+auth error, which reads as a missing package and sends you looking in the wrong
260
+place. Adding an `environment:` to the job without setting the matching
261
+Environment name field on that npm page is the usual way to cause it.
262
248
-`NPM_TOKEN` — a granular npm access token scoped to the `@ondeinference` org
249
-with read+write packages. Create at npmjs.com → Access Tokens.
263
+The job also upgrades npm before publishing: Node 22 ships npm 10, and trusted
264
+publishing needs 11.5.1 or newer.
265
266
---
267
347
| `CARGO_REGISTRY_TOKEN` | `release-sdk-rust.yml` | Authenticate with crates.io for `cargo publish`. Scoped to `publish-update` for the `onde` crate. Create at https://crates.io/settings/tokens. |
348
| `ONDE_SWIFT_PAT` | `release-sdk-swift.yml` | Push commits + tags to `ondeinference/onde-swift`. Must be a PAT (not `GITHUB_TOKEN`) so it triggers workflows on `onde-swift`. Needs `contents: write` scope. |
349
| `PUB_CREDENTIALS` | `release-sdk-dart.yml` | Authenticate with pub.dev for `flutter pub publish`. Full JSON from `~/.config/dart/pub-credentials.json`. |
335
-| `NPM_TOKEN` | `release-sdk-npm.yml` | Authenticate with npm for `npm publish`. Granular access token scoped to the `@ondeinference` org with read+write packages. Create at npmjs.com → Access Tokens. |
350
| `ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME` | `release-sdk-kotlin.yml` | Sonatype Central Portal token username. Generate at central.sonatype.com → Profile → Generate User Token. |
351
| `ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD` | `release-sdk-kotlin.yml` | Sonatype Central Portal token password. Same dialog as above. |
352
| `ORG_GRADLE_PROJECT_SIGNINGKEYID` | `release-sdk-kotlin.yml` | Last 8 chars of GPG key fingerprint used to sign Maven Central artifacts. |
371
| Forgot to update `sdk/react-native/rust/Cargo.lock` | npm SDK's Rust bridge builds against stale `onde` version | Run `cd sdk/react-native/rust && cargo update -p onde` |
372
| Forgot to update `sdk/dart/CHANGELOG.md` | pub.dev shows stale changelog | Prepend new `## 0.1.3` section before tagging |
373
| Forgot to bump `sdk/react-native/CHANGELOG.md` | npm shows stale changelog | Prepend new `## 0.1.3` section before tagging |
374
+| Forgot to update the root `CHANGELOG.md` | No CI failure at all, the file just goes stale silently | Prepend the new section before tagging. Nothing validates this one, so it is the easiest to miss |
375
| Forgot to bump `sdk/kotlin/gradle.properties` `VERSION_NAME` | Kotlin CI fails: tag vs gradle.properties mismatch | Bump `VERSION_NAME`, amend commit, re-tag |
376
| Tag has `v` prefix (`v0.1.3`) | CI does not trigger — tag pattern requires bare semver | Delete the tag, re-tag without `v` |
377
| `CARGO_REGISTRY_TOKEN` missing | `cargo publish` fails with auth error | Create a scoped token at crates.io/settings/tokens, add as repo secret |
378
| `ONDE_SWIFT_PAT` expired | `onde-swift` push fails with 403 | Regenerate PAT at github.com/settings/tokens, update repo secret |
379
| `PUB_CREDENTIALS` expired | `flutter pub publish` fails with 401 | Run `dart pub login` locally, copy new credentials JSON to repo secret |
365
-| `NPM_TOKEN` expired | `npm publish` fails with 401/403 | Regenerate token at npmjs.com → Access Tokens, update repo secret |
380
+| npm trusted publisher does not match the workflow | `npm publish` fails with a 404 on PUT, not a 401 | Check repo, workflow filename, and environment on npmjs.com/package/@ondeinference/react-native/access against what the `publish` job declares |
381
| crates.io version already published | `cargo publish` fails with "already uploaded" | crates.io is immutable — bump to next version. `cargo yank` hides but doesn't delete. |
382
| npm version already published | npm publish step skips (idempotency guard) | Safe — the workflow exits 0. No action needed. |
383
| pub.dev version already published | `flutter pub publish` fails | pub.dev is immutable — bump to next version |
449
npm publish --access public
450
```
451
437
-Requires `npm login` or `NPM_TOKEN` env var.
452
+Requires `npm login`. Trusted publishing is CI-only, so a manual publish falls
453
+back to your own npm credentials.
454
455
### When to use manual publish
456