Skip to content

Commit 1ea2f38

Browse files
committed
chore(github): ignore "always exists on crates.io index" errors
1 parent ae49e48 commit 1ea2f38

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,16 @@ jobs:
296296
- name: Publish to crates.io
297297
run: |
298298
# Try to publish, but don't fail if the version already exists
299-
cargo publish --verbose || {
299+
OUTPUT=$(cargo publish --verbose 2>&1) && echo "$OUTPUT" || {
300300
EXIT_CODE=$?
301+
echo "$OUTPUT"
301302
# Check if it failed because the version already exists
302-
cargo search sql-schema --limit 1 | grep -q "sql-schema = \"$CARGO_VERSION\"" && {
303-
echo "Version $CARGO_VERSION already published on crates.io, skipping..."
303+
if echo "$OUTPUT" | grep -q "already exists on crates.io"; then
304+
echo "Version $CARGO_VERSION already published on crates.io, skipping..."
304305
exit 0
305-
}
306+
fi
306307
# If it failed for another reason, exit with the original error code
308+
echo "❌ Publishing failed with error code $EXIT_CODE"
307309
exit $EXIT_CODE
308310
}
309311
env:

0 commit comments

Comments
 (0)