Skip to content

Commit fdaa101

Browse files
ci: handle already-published release and crates.io version gracefully
1 parent 9692bdc commit fdaa101

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,15 @@ jobs:
317317
env:
318318
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
319319
run: |
320-
gh release create ${{ github.ref_name }} \
321-
release-files/* \
322-
--title "Shimmy ${{ github.ref_name }}" \
323-
--generate-notes
320+
if gh release view ${{ github.ref_name }} > /dev/null 2>&1; then
321+
echo "Release already exists — uploading binaries to existing release"
322+
gh release upload ${{ github.ref_name }} release-files/* --clobber
323+
else
324+
gh release create ${{ github.ref_name }} \
325+
release-files/* \
326+
--title "Shimmy ${{ github.ref_name }}" \
327+
--generate-notes
328+
fi
324329
325330
- name: Install Rust for Rust steps
326331
uses: dtolnay/rust-toolchain@stable
@@ -331,7 +336,11 @@ jobs:
331336
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
332337
run: |
333338
# Publish the crates.io-safe version (huggingface default, no airframe path dep)
334-
cargo publish --no-default-features --features huggingface
339+
if cargo publish --no-default-features --features huggingface 2>&1 | grep -q 'already exists'; then
340+
echo "ℹ️ shimmy already published to crates.io — skipping"
341+
else
342+
cargo publish --no-default-features --features huggingface
343+
fi
335344
echo "✅ Published shimmy to crates.io"
336345
echo "ℹ️ crates.io version uses huggingface engine. Airframe GPU binaries are in GitHub Releases above."
337346
echo "ℹ️ To use Airframe GPU: download the platform binary from GitHub Releases."

0 commit comments

Comments
 (0)