fix: allow release reruns when crates exist

This commit is contained in:
Michael A. Kuykendall
2025-12-09 11:12:08 -06:00
parent f5cbb34ab8
commit c96f43ebd4
2 changed files with 6 additions and 2 deletions

View File

@@ -356,13 +356,16 @@ jobs:
# Skip publish if this version already exists on crates.io (allows re-running release without bump)
VERSION="${GITHUB_REF_NAME#v}"
if curl -sSf "https://crates.io/api/v1/crates/shimmy/${VERSION}" >/dev/null; then
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://crates.io/api/v1/crates/shimmy/${VERSION}")
if [[ "$STATUS" == "200" ]]; then
echo " shimmy ${VERSION} already published to crates.io; skipping publish"
else
elif [[ "$STATUS" == "404" ]]; then
# Publish to crates.io (dry-run already validated in Gate 7)
cargo publish $DIRTY_FLAG || (echo "❌ cargo publish failed"; exit 1)
echo "✅ Successfully published shimmy ${{ github.ref_name }} to crates.io!"
echo "📦 Users can now install with: cargo install shimmy"
else
echo "⚠️ crates.io lookup returned HTTP ${STATUS}; assuming ${VERSION} is already published and skipping publish"
fi
- name: "🐳 Build and Push Docker Image to GHCR"

View File

@@ -305,6 +305,7 @@ impl LlamaEngine {
/// Calculate adaptive batch size based on context length to prevent GGML assert failures
/// with large prompts (Issue #140)
#[cfg(feature = "llama")]
fn calculate_adaptive_batch_size(ctx_len: usize) -> u32 {
// Base batch size for smaller contexts
const BASE_BATCH_SIZE: u32 = 2048;