From 65d667b5e1999cb98ebbb6368d4594e7ed526ed5 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 21 Oct 2026 19:30:07 +0700 Subject: [PATCH] fix: accept CRLF checkouts when patching the legacy release lockfile version Git for Windows checks Cargo.lock out with CRLF endings on the windows-latest runner, so the whole-line sed and grep anchors matched nothing and the rollback build stopped at its own check. The patterns now allow a trailing CR and keep it, and the check runs on a CR-stripped copy. --- .github/workflows/release-legacy.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-legacy.yml b/.github/workflows/release-legacy.yml index e814513..12a899f 100644 --- a/.github/workflows/release-legacy.yml +++ b/.github/workflows/release-legacy.yml @@ -94,7 +94,9 @@ jobs: # Only the package's own version changes, in Cargo.toml and its # Cargo.lock entry, so the `--locked` build below resolves nothing and - # fails if the lockfile differs in anything else. + # fails if the lockfile differs in anything else. Git for Windows checks + # the files out with CRLF endings, so the patterns accept a trailing CR + # and keep it. - name: Set the Cargo.toml and Cargo.lock version run: | sed -i -E '0,/^version[[:space:]]*=/s/^version[[:space:]]*=[[:space:]]*"[^"]*"/version = "'"$VERSION"'"/' Cargo.toml @@ -103,8 +105,8 @@ jobs: echo "::error::Cargo.toml version is '$actual' after patching, expected '$VERSION'." exit 1 fi - sed -i -E '/^name = "claude-code-usage-bubble"$/{n;s/^version = "[^"]*"$/version = "'"$VERSION"'"/}' Cargo.lock - if ! grep -A1 -x 'name = "claude-code-usage-bubble"' Cargo.lock | grep -qx "version = \"$VERSION\""; then + sed -i -E '/^name = "claude-code-usage-bubble"\r?$/{n;s/^version = "[^"]*"(\r?)$/version = "'"$VERSION"'"\1/}' Cargo.lock + if ! tr -d '\r' < Cargo.lock | grep -A1 -x 'name = "claude-code-usage-bubble"' | grep -qx "version = \"$VERSION\""; then echo "::error::Cargo.lock has no claude-code-usage-bubble entry at version '$VERSION' after patching." exit 1 fi