14
(darwin-arm64/x64, linux-x64/arm64, windows-x64) and publishes a GitHub release
15
with auto-generated notes and the archives attached.
16
- `.github/workflows/release-crates.yml` — runs `cargo publish --locked` to push
17
- the crate to crates.io (needs the `CARGO_REGISTRY_TOKEN` repo secret).
17
+ the crate to crates.io, authenticated by **trusted publishing**: a GitHub OIDC
18
+ token is exchanged for a short-lived crates.io token. There is no
19
+ `CARGO_REGISTRY_TOKEN` secret to store or rotate.
20
21
Branch model: work lands on `development` (via PRs); `main` is the release branch;
22
every tag points at a commit that is on `main`. Previous tags were plain annotated
24
25
---
26
27
+## 0. One-time setup: the trusted publisher
28
+
29
+Trusted publishing needs a publisher registered on crates.io **before** the first
30
+tagged run. The crate must already be on crates.io (a first-ever publish still
31
+needs a manual `cargo login` + `cargo publish`), and you must be a crate owner.
32
+Then: crate page → **Settings → Trusted Publishing → Add → GitHub**:
33
+
34
+- Repository owner: `SplitFireAI`
35
+- Repository name: `splitfire-agent`
36
+- Workflow filename: `release-crates.yml` (the bare filename, not a path)
37
+- Environment: leave blank unless the job also declares `environment:`
38
+
39
+The workflow filename is part of the trust claim, so renaming the workflow breaks
40
+publishing until the crates.io config is updated to match — keep the two in sync.
41
+
42
+---
43
+
44
## 1. Confirm the version is bumped
45
46
The version bump often already landed with the feature PR — check before assuming
144
already on crates.io, so no dependency needs publishing first. To publish manually
145
instead of via CI: `cargo login` once (token from crates.io/settings/tokens), then
146
`cargo publish --locked` from the tagged commit.
147
+- `crates-io-auth-action` is pinned to `v1.0.5` deliberately: the action repo has
148
+ no moving `v1` tag (only `v1.0.x`), so the `@v1` shown in the crates.io docs
149
+ example fails to resolve. Bump the pin when a newer release lands.
150
- If a platform build fails after the tag is pushed, fix the cause and re-run the
151
failed jobs (`gh run rerun <run-id> --failed`); the release-create step tolerates
152
an already-existing release and `--clobber`s assets, so re-runs are safe.