From c6f0ff70d7bd7177edcdf6881b228e130e2ffdec Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:28:23 -0500 Subject: [PATCH 1/8] ci: add RubyGems registry check Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/registry-check.yml diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml new file mode 100644 index 0000000..e26c44b --- /dev/null +++ b/.github/workflows/registry-check.yml @@ -0,0 +1,79 @@ +name: Check RubyGems release + +on: + push: + tags: + - "v*" + workflow_dispatch: + inputs: + version: + description: "Gem version to look for on RubyGems, for example 6.2.0" + required: true + type: string + +permissions: + contents: read + +jobs: + check: + name: Confirm version is on RubyGems + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + GEM_NAME: customerio + # Poll every 3 minutes for up to 50 minutes. + POLL_INTERVAL_SECONDS: "180" + POLL_TIMEOUT_SECONDS: "3000" + # Secrets can't be read in step `if`, so the alert step tests this copy. + # Empty until the org secret exists, which skips the alert. + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_SERVER_SDK_RELEASES_WEBHOOK_URL }} + + steps: + - name: Wait for the version to appear on RubyGems + id: check + env: + RAW_VERSION: ${{ inputs.version || github.ref_name }} + run: | + version="${RAW_VERSION#v}" + if ! [[ "$version" =~ ^[0-9A-Za-z][0-9A-Za-z.+_-]*$ ]]; then + echo "::error::'$RAW_VERSION' is not a valid version" + exit 1 + fi + echo "version=$version" >> "$GITHUB_OUTPUT" + + url="https://rubygems.org/api/v2/rubygems/${GEM_NAME}/versions/${version}.json" + deadline=$(( $(date +%s) + POLL_TIMEOUT_SECONDS )) + while true; do + status=$(curl -s -o /dev/null -w '%{http_code}' --max-time 20 "$url" || true) + if [ "$status" = "200" ]; then + echo "${GEM_NAME} ${version} is on RubyGems" + exit 0 + fi + echo "${GEM_NAME} ${version} not found yet (HTTP ${status:-none})" + if [ "$(date +%s)" -ge "$deadline" ]; then + echo "::error::${GEM_NAME} ${version} was not on RubyGems after ${POLL_TIMEOUT_SECONDS}s" + exit 1 + fi + sleep "$POLL_INTERVAL_SECONDS" + done + + - name: Alert Slack that the version is missing + if: failure() && steps.check.outcome == 'failure' && env.SLACK_WEBHOOK_URL != '' + uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v2.0.0-rc.3 + with: + webhook: ${{ env.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "text": "Ruby SDK ${{ steps.check.outputs.version }} is missing from RubyGems", + "channel": "#server-sdk-deployments", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Ruby* SDK ${{ steps.check.outputs.version }} is not on RubyGems :warning: after 50 minutes :warning:\nThe release may not have been published. View ." + } + } + ] + } From 344fc7976e9557991ffbb5bbf8607b7bf9a24bb6 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:30:36 -0500 Subject: [PATCH 2/8] ci: post release notices to #mobile-deployments Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index e26c44b..862b48f 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -26,7 +26,7 @@ jobs: POLL_TIMEOUT_SECONDS: "3000" # Secrets can't be read in step `if`, so the alert step tests this copy. # Empty until the org secret exists, which skips the alert. - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_SERVER_SDK_RELEASES_WEBHOOK_URL }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_RELEASES_WEBHOOK_URL }} steps: - name: Wait for the version to appear on RubyGems @@ -66,7 +66,7 @@ jobs: payload: | { "text": "Ruby SDK ${{ steps.check.outputs.version }} is missing from RubyGems", - "channel": "#server-sdk-deployments", + "channel": "#mobile-deployments", "blocks": [ { "type": "section", From fc08217466d3464298d2d70e6abe1705b4df18d8 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:40:35 -0500 Subject: [PATCH 3/8] ci: post release notices to #server-sdk-deployments Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index 862b48f..7527abe 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -66,7 +66,7 @@ jobs: payload: | { "text": "Ruby SDK ${{ steps.check.outputs.version }} is missing from RubyGems", - "channel": "#mobile-deployments", + "channel": "#server-sdk-deployments", "blocks": [ { "type": "section", From e92e540124d07e0748c4736022c16dd130171e57 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:49:55 -0500 Subject: [PATCH 4/8] ci: give release notices a bot name and logo Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index 7527abe..34b70f0 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -66,6 +66,8 @@ jobs: payload: | { "text": "Ruby SDK ${{ steps.check.outputs.version }} is missing from RubyGems", + "username": "Ruby deployment bot", + "icon_url": "https://raw.githubusercontent.com/github/explore/main/topics/ruby/ruby.png", "channel": "#server-sdk-deployments", "blocks": [ { From e1c104680aa3ceb82ed8fe363112782f8ff604df Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:20:50 -0500 Subject: [PATCH 5/8] ci: keep Slack problems from failing a release Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index 34b70f0..a282152 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -59,7 +59,8 @@ jobs: - name: Alert Slack that the version is missing if: failure() && steps.check.outcome == 'failure' && env.SLACK_WEBHOOK_URL != '' - uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v2.0.0-rc.3 + uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0 + continue-on-error: true with: webhook: ${{ env.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook From c2dad79ae17297d8b67e62b83adc1cb2a4fb8745 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 17:25:15 -0500 Subject: [PATCH 6/8] ci: start the registry check after the publish workflow finishes Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index a282152..5aa671e 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -1,9 +1,11 @@ name: Check RubyGems release +# The publish job waits for an approval, so the wait starts when that workflow +# finishes, not when the tag is pushed. on: - push: - tags: - - "v*" + workflow_run: + workflows: [Publish to RubyGems] + types: [completed] workflow_dispatch: inputs: version: @@ -17,6 +19,8 @@ permissions: jobs: check: name: Confirm version is on RubyGems + # A cancelled publish run released nothing. + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion != 'cancelled' }} runs-on: ubuntu-latest timeout-minutes: 60 env: @@ -32,7 +36,8 @@ jobs: - name: Wait for the version to appear on RubyGems id: check env: - RAW_VERSION: ${{ inputs.version || github.ref_name }} + # For a publish run started by a tag push, head_branch is the tag. + RAW_VERSION: ${{ inputs.version || github.event.workflow_run.head_branch }} run: | version="${RAW_VERSION#v}" if ! [[ "$version" =~ ^[0-9A-Za-z][0-9A-Za-z.+_-]*$ ]]; then @@ -75,7 +80,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*Ruby* SDK ${{ steps.check.outputs.version }} is not on RubyGems :warning: after 50 minutes :warning:\nThe release may not have been published. View ." + "text": "*Ruby* SDK ${{ steps.check.outputs.version }} is not on RubyGems 50 minutes after the publish workflow finished :warning:\nThe release may not have been published. View ." } } ] From 801c991deac85fe57c00261c628756a0f0459c68 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Tue, 24 Nov 2026 17:35:14 -0500 Subject: [PATCH 7/8] ci: check the registry only after a successful publish Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index 5aa671e..ca3a382 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -19,8 +19,9 @@ permissions: jobs: check: name: Confirm version is on RubyGems - # A cancelled publish run released nothing. - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion != 'cancelled' }} + # A publish run that failed, was cancelled or had its approval rejected + # uploaded nothing, and the run itself already shows that. + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest timeout-minutes: 60 env: From f49507aa3e5039c38d0c32af61bd35eca521f095 Mon Sep 17 00:00:00 2001 From: sydneycollins-cio <149523950+sydneycollins-cio@users.noreply.github.com> Date: Wed, 25 Nov 2026 09:44:02 -0500 Subject: [PATCH 8/8] ci: check the registry after any publish result Co-Authored-By: Claude Fable 5.2 --- .github/workflows/registry-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/registry-check.yml b/.github/workflows/registry-check.yml index ca3a382..50de30f 100644 --- a/.github/workflows/registry-check.yml +++ b/.github/workflows/registry-check.yml @@ -19,9 +19,9 @@ permissions: jobs: check: name: Confirm version is on RubyGems - # A publish run that failed, was cancelled or had its approval rejected - # uploaded nothing, and the run itself already shows that. - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + # Runs after every publish run, failed and cancelled ones too. The tag + # already exists by then, and a failed publish can still have uploaded the + # package, so the registry is the only way to tell. runs-on: ubuntu-latest timeout-minutes: 60 env: @@ -81,7 +81,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*Ruby* SDK ${{ steps.check.outputs.version }} is not on RubyGems 50 minutes after the publish workflow finished :warning:\nThe release may not have been published. View ." + "text": "*Ruby* SDK ${{ steps.check.outputs.version }} is not on RubyGems 50 minutes after the publish workflow finished :warning:\nThe publish workflow ended as ${{ github.event.workflow_run.conclusion || 'not run' }}. View ." } } ]