File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments