Skip to content

Commit e784e9a

Browse files
author
David Elner
committed
Changed: Auto bump off most recently published version not job number
1 parent f959a94 commit e784e9a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/release-ruby.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ jobs:
7272
outputs:
7373
version: ${{ steps.bump.outputs.version }}
7474
steps:
75-
# bt-fake: generates a version from the run number — no version bump PR needed.
76-
# Remove this job in real SDK workflows; version comes from the version bump PR.
75+
# bt-fake: derives next version by querying RubyGems.org and incrementing the
76+
# patch. Falls back to 0.0.1 on first publish (404). Remove this job in real
77+
# SDK workflows; version comes from the version bump PR.
7778
- name: Bump version
7879
id: bump
79-
run: echo "version=0.0.${{ github.run_number }}" >> $GITHUB_OUTPUT
80+
run: |
81+
CURRENT=$(curl -sf https://rubygems.org/api/v1/gems/bt-fake.json | jq -r '.version' || echo "0.0.0")
82+
IFS='.' read -r major minor patch <<< "$CURRENT"
83+
echo "version=$major.$minor.$((patch + 1))" >> $GITHUB_OUTPUT
8084
8185
validate:
8286
needs: bump

0 commit comments

Comments
 (0)