@smbcloud / cli / commits / 09c709a

Fix the SDK gem release matrix and let a partial release be completed

Adding a gem dimension next to the include-only platform list made each include entry overwrite the previous one, so only darwin-x64 gems were built. smbcloud-model 0.7.5 went out with just the source gem and x86_64-darwin. Make the platform name a matrix dimension and let include add the runner and platform to it. The per-gem "version already exists" check would skip the missing platforms on a re-run. Remove it and rely on the per-file push instead, which now skips only RubyGems' "repushing is not allowed" error and fails on anything else, where it used to swallow every error as a warning. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Seto Elkahfi committed Oct 24, 2026 at 11:20 UTC 09c709a69103a31501cd0b5dc92e422a222f0111
1 file changed +12 -22
.github/workflows/release-sdk-gem.yml
+12 -22
@@ -34,6 +34,7 @@ jobs:
34 fail-fast: false
35 matrix:
36 gem: [auth, model]
37 + name: [linux-x64, linux-arm64, darwin-arm64, darwin-x64]
38 include:
39 - { name: linux-x64, runner: ubuntu-latest, platform: x86_64-linux }
40 - {
@@ -220,21 +221,7 @@ jobs:
221 fi
222 echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
223
223 - - name: Check whether release already exists on RubyGems
224 - id: rubygems-check
225 - shell: bash
226 - run: |
227 - if curl -fsS \
228 - "https://rubygems.org/api/v2/rubygems/smbcloud-${{ matrix.gem }}/versions/${RELEASE_VERSION}.json" \
229 - >/dev/null 2>&1; then
230 - echo "smbcloud-${{ matrix.gem }} ${RELEASE_VERSION} already exists on RubyGems, skipping publish"
231 - echo "exists=true" >> "$GITHUB_OUTPUT"
232 - else
233 - echo "exists=false" >> "$GITHUB_OUTPUT"
234 - fi
235 -
224 - name: Download all gem artifacts
237 - if: steps.rubygems-check.outputs.exists != 'true'
225 uses: actions/download-artifact@v7
226 with:
227 pattern: "gem-${{ matrix.gem }}-*"
@@ -242,28 +229,31 @@ jobs:
229 merge-multiple: true
230
231 - name: Setup Ruby
245 - if: steps.rubygems-check.outputs.exists != 'true'
232 uses: ruby/setup-ruby@v1
233 with:
234 ruby-version: .ruby-version
235
236 - name: Configure RubyGems credentials
251 - if: steps.rubygems-check.outputs.exists != 'true'
237 shell: bash
238 run: |
239 mkdir -p "${HOME}/.gem"
240 echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > "${HOME}/.gem/credentials"
241 chmod 0600 "${HOME}/.gem/credentials"
242
258 - # Push each .gem file individually. Platform-specific gems that are already
259 - # published (e.g. from a re-run) emit a warning and continue rather than
260 - # failing the whole job.
243 + # Push each .gem file individually. A file that is already published (a
244 + # re-run, or completing a partial release) is skipped; any other failure
245 + # fails the job.
246 - name: Push gems to RubyGems
262 - if: steps.rubygems-check.outputs.exists != 'true'
247 shell: bash
248 run: |
249 for gem_file in gems/*.gem; do
250 echo "Pushing $(basename "${gem_file}")…"
267 - gem push "${gem_file}" \
268 - || echo "::warning::$(basename "${gem_file}") may already exist for this version — skipping."
251 + if output=$(gem push "${gem_file}" 2>&1); then
252 + echo "${output}"
253 + elif grep -q "Repushing of gem versions is not allowed" <<<"${output}"; then
254 + echo "::notice::$(basename "${gem_file}") is already on RubyGems, skipping."
255 + else
256 + echo "${output}" >&2
257 + exit 1
258 + fi
259 done