From f1e8c30f5134b045a3a7cf4d440917777a513389 Mon Sep 17 00:00:00 2001 From: Aviator 5 Date: Fri, 5 Jun 2026 16:27:45 +0300 Subject: [PATCH] fix(ci): refresh sparse index before each publish attempt Signed-off-by: Aviator 5 --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 798719d..c84d420 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -482,6 +482,12 @@ jobs: return 0 fi for attempt in 1 2 3; do + # Drop the cached sparse index before each attempt. rust-cache restores a + # registry index snapshot that can predate internal crates just published + # earlier in this job (e.g. gts-validator -> gts ^0.10.0), causing + # "failed to select a version for the requirement". Clearing forces cargo + # to re-fetch fresh index entries that include the new versions. + rm -rf ~/.cargo/registry/index # Token scoped to this single invocation only, not the surrounding shell environment if CARGO_REGISTRY_TOKEN="${{ secrets.CARGO_REGISTRY_TOKEN }}" cargo publish -p "${crate}" --locked; then echo "${crate} published successfully on attempt ${attempt}."