Use shared-config's reusable CD workflow for gem releases - #21
Merged
Merged
Conversation
push_gem.yml ran rubygems/release-gem on every push to main, which fails whenever the version hasn't been bumped because RubyGems rejects repushing an existing version. Switch to the shared-config reusable CD workflow that the other rubyatscale gems use. It runs after CI passes on main and skips the release when the version's tag already exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"Publish to Rubygems" (
push_gem.yml) has been failing onmain(run). It ranrubygems/release-gemon every push tomain, and that action always pushes the gem. RubyGems rejects a repush of an existing version, so every commit that didn't bump the version failed:This PR replaces
push_gem.ymlwith acd.ymlthat callsrubyatscale/shared-config/.github/workflows/cd.yml@main. The file is identical to the caller incode_teams, and most other rubyatscale gems (packs,packs-rails,rubocop-packs, …) use the same one. It runs after CI passes onmain. If thev<version>tag already exists it skips the release; otherwise it tags, pushes the gem, and creates a GitHub release. It also posts to Slack if a run fails.Notes
RUBYGEMS_API_KEYsecret (gusto-open-source, which owns the gem) instead of trusted publishing. Once this merges, the trusted publisher forpush_gem.ymlon rubygems.org is unused and can be removed.workflow_runworkflows only run from the default branch, so this can't be exercised on the PR. Its first run after merge should skip, becausev1.9.0already exists.actionlintandzizmorpass locally.