Commit 86d485a
ci: make crates.io publish idempotent and retry index lag (#735)
* ci: make crates.io publish idempotent and retry index lag
The publish job ran six `cargo publish` commands unguarded under `set -e`.
Two failure modes broke it:
1. Partial release: if a later crate fails, the already-uploaded crates
can't be re-published — a re-dispatch aborts immediately on the first
`cargo publish` ("crate version already uploaded").
2. Index lag: a dependent crate (e.g. icx -> ic-utils) can fail to
resolve a just-uploaded dependency until the crates.io index catches
up, which can take a minute or two.
Both hit the 0.48.0 release: ic-transport-types, ic-agent, ic-identity-hsm,
and ic-utils published, then `icx` failed to resolve `ic-utils = ^0.48.0`
because the index hadn't surfaced it yet.
Wrap each publish in a helper that treats "already uploaded/exists" as
success (idempotent re-runs) and retries other failures up to 6x with a
30s backoff (rides out index lag). Re-dispatching now finishes icx and
icx-cert without re-publishing the four crates already live.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: skip final-attempt sleep in publish retry loop
Don't sleep 30s after the last attempt fails — it only delayed the job's
failure. Gate the backoff on there being another attempt to come, and
include attempt count in the messages.
Addresses Copilot review feedback on #735.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7e8dc0e commit 86d485a
1 file changed
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
20 | 47 | | |
21 | 48 | | |
0 commit comments