Skip to content

ci: auto-publish gem from release-please run (hexlet-ide pattern)#11

Merged
mokevnin merged 1 commit into
mainfrom
ci/fold-publish-into-release
Jun 26, 2026
Merged

ci: auto-publish gem from release-please run (hexlet-ide pattern)#11
mokevnin merged 1 commit into
mainfrom
ci/fold-publish-into-release

Conversation

@mokevnin

Copy link
Copy Markdown
Member

Why

GitHub deliberately blocks events triggered by GITHUB_TOKEN from starting other workflows (anti-recursion guardrail — there is no setting to allow it). So the release that release-please creates under GITHUB_TOKEN never fired the release: published-based publish-gem.yml, and 0.4.3 had to be published manually.

What

Fold publishing into the release workflow as a downstream job gated on the action's release_created output — the same two-job pattern as hexlet-ide's release.yml. The publish job runs in the same workflow invocation that cuts the release, so no cross-workflow trigger (and no PAT) is needed.

  • Rename release-please.ymlrelease.yml with two jobs:
    • release-please (googleapis/release-please-action@v5) exposing release_created / version outputs;
    • publishneeds: release-please, if: needs.release-please.outputs.release_created == 'true' — sets up Ruby and runs bin/publish-gem with the existing GEM_HOST_API_KEY secret.
  • Reduce publish-gem.yml to a manual workflow_dispatch fallback (dropped the dead release: published trigger) for re-publishing an existing release.

After this merges, future releases publish to RubyGems automatically when the release PR is merged.

🤖 Generated with Claude Code

GitHub deliberately blocks GITHUB_TOKEN-triggered events from starting
other workflows, so a release created by release-please never fired the
release:published-based publish-gem workflow. Rather than introduce a PAT,
fold publishing into the release workflow as a downstream job gated on the
action's release_created output (the same pattern used in hexlet-ide):
the publish job runs in the same workflow invocation that cuts the
release, so no cross-workflow trigger is needed.

Rename release-please.yml to release.yml (release-please + publish jobs)
and reduce publish-gem.yml to a manual workflow_dispatch fallback for
re-publishing an existing release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mokevnin mokevnin merged commit 349d64d into main Jun 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant