Skip to content

Commit 5539616

Browse files
committed
Update ruby SDK from OpenAPI spec
1 parent a6f700d commit 5539616

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/publish-ruby.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# .github/workflows/publish-ruby.yml
21
name: Publish Ruby Gem
32

43
on:
@@ -70,7 +69,26 @@ jobs:
7069
run: |
7170
GEM_FILE=$(ls *.gem | head -1)
7271
echo "Publishing $GEM_FILE to RubyGems..."
73-
gem push "$GEM_FILE"
72+
73+
# Get gem name and version for debugging
74+
GEM_NAME=$(gem specification "$GEM_FILE" name)
75+
GEM_VERSION=$(gem specification "$GEM_FILE" version)
76+
echo "Gem name: $GEM_NAME"
77+
echo "Gem version: $GEM_VERSION"
78+
79+
# Check if gem already exists
80+
if gem list "$GEM_NAME" --remote | grep -q "$GEM_NAME"; then
81+
echo "Gem $GEM_NAME already exists on RubyGems.org"
82+
# Check if this specific version exists
83+
if gem list "$GEM_NAME" --remote --exact | grep -q "$GEM_VERSION"; then
84+
echo "ERROR: Version $GEM_VERSION of $GEM_NAME already exists!"
85+
echo "You need to increment the version number."
86+
exit 1
87+
fi
88+
fi
89+
90+
# Try to push with verbose output
91+
gem push "$GEM_FILE" --verbose
7492
echo "✓ Successfully published to RubyGems.org"
7593
7694
- name: Clean up credentials

0 commit comments

Comments
 (0)