From 1b2a4c9442fedd3a1880d3556764140f4106c1f1 Mon Sep 17 00:00:00 2001 From: Esteban Dimitroff Hodi Date: Fri, 13 Mar 2026 17:18:20 -0300 Subject: [PATCH] fix: make release workflow idempotent for already-published crates --- .github/workflows/release.yaml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 48b9908..97f2d90 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,16 +17,40 @@ jobs: override: true - name: Publish spawned-macros - run: cargo publish --package spawned-macros --token ${{ secrets.CRATES_IO_TOKEN }} + run: | + OUTPUT=$(cargo publish --package spawned-macros --token ${{ secrets.CRATES_IO_TOKEN }} 2>&1) || { + if echo "$OUTPUT" | grep -q "already exists"; then + echo "spawned-macros already published, continuing" + else + echo "$OUTPUT" + exit 1 + fi + } - name: Wait for crates.io indexing run: sleep 30 - name: Publish spawned-rt - run: cargo publish --package spawned-rt --token ${{ secrets.CRATES_IO_TOKEN }} + run: | + OUTPUT=$(cargo publish --package spawned-rt --token ${{ secrets.CRATES_IO_TOKEN }} 2>&1) || { + if echo "$OUTPUT" | grep -q "already exists"; then + echo "spawned-rt already published, continuing" + else + echo "$OUTPUT" + exit 1 + fi + } - name: Wait for crates.io indexing run: sleep 30 - name: Publish spawned-concurrency - run: cargo publish --package spawned-concurrency --token ${{ secrets.CRATES_IO_TOKEN }} + run: | + OUTPUT=$(cargo publish --package spawned-concurrency --token ${{ secrets.CRATES_IO_TOKEN }} 2>&1) || { + if echo "$OUTPUT" | grep -q "already exists"; then + echo "spawned-concurrency already published, continuing" + else + echo "$OUTPUT" + exit 1 + fi + }