Skip to content

Commit 3b6a5de

Browse files
Release workflow: tolerate Cargo.lock changes; always run Docker publish step (avoid skipped GHCR push)
- Use --allow-dirty for crates.io publish to avoid transient Cargo.lock blocking release - Add git status/diff debug logs for easier triage - Run Docker publish step even if crates.io publish fails (if: always())
1 parent 387cadf commit 3b6a5de

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,23 +343,25 @@ jobs:
343343
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
344344
run: |
345345
echo "🚀 Publishing shimmy ${{ github.ref_name }} to crates.io..."
346-
347-
# Handle uncommitted Cargo.lock (same logic as Gate 7)
348-
if git status --porcelain | grep -q "Cargo.lock"; then
349-
echo "⚠️ Cargo.lock has uncommitted changes (using --allow-dirty)"
350-
DIRTY_FLAG="--allow-dirty"
351-
else
352-
echo "✅ No uncommitted changes detected"
353-
DIRTY_FLAG=""
354-
fi
355-
346+
# Debug: print working tree state (helps diagnose Cargo.lock vs git status mismatch)
347+
echo "🔍 git status (porcelain):"
348+
git status --porcelain || true
349+
echo "🔍 git diff --name-only against HEAD (if any):"
350+
git diff --name-only || true
351+
352+
# When publishing we always allow dirty state for Cargo.lock differences that appear
353+
# during build/packaging steps (this prevents transient lockfile updates from blocking publish)
354+
echo "⚠️ Publishing with --allow-dirty to tolerate transient changes to Cargo.lock"
355+
DIRTY_FLAG="--allow-dirty"
356+
356357
# Publish to crates.io (dry-run already validated in Gate 7)
357-
cargo publish $DIRTY_FLAG
358+
cargo publish $DIRTY_FLAG || (echo "❌ cargo publish failed"; exit 1)
358359
359360
echo "✅ Successfully published shimmy ${{ github.ref_name }} to crates.io!"
360361
echo "📦 Users can now install with: cargo install shimmy"
361362
362363
- name: "🐳 Build and Push Docker Image to GHCR"
364+
if: always()
363365
env:
364366
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
365367
run: |

0 commit comments

Comments
 (0)