Port release workflows and scripts from main to 3.x - #2705
Closed
joelhawksley wants to merge 1 commit into
Closed
Conversation
Bring 3.x in line with main's automated release pipeline so 3.x maintenance releases can be cut via workflow_dispatch instead of a maintainer running scripts locally. Ported from main: - .github/workflows/release.yml — workflow_dispatch that runs script/release with major/minor/patch inputs and opens a release PR. - .github/workflows/publish-release.yml — triggers on push to 3.x (or manual dispatch) and runs script/publish. - .github/workflows/push_gem.yml — pushes the tagged gem to RubyGems via Trusted Publishing. - script/release — includes every fix that landed on main (DEPRECATION_HORIZON sed on the quoted string, main "$@", bundle frozen-mode fixes, lockfile sed instead of bundle lock, idempotent push/PR creation, hard-failing docs build). - script/publish — includes all main fixes (GITHUB_TOKEN-compatible permission probe, explicit push_gem dispatch against tag ref). - script/sync_contributors.rb — needed by build_docs. 3.x-specific adjustments: - publish-release.yml triggers on push to 3.x, not main. - script/release accepts both main and 3.x as valid release branches. - The release PR base is set from branch_name() so the same script cuts main-targeted PRs on main and 3.x-targeted PRs on 3.x. - script/publish only publishes gh-pages when run from main. gh-pages hosts a single docs site, so publishing from 3.x would clobber the current (4.x) docs. 3.x still gets tagged and released — just no gh-pages update. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
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.
Brings 3.x in line with main's automated release pipeline so 3.x maintenance releases can be cut via
workflow_dispatchinstead of relying on a maintainer running scripts locally.Supersedes #2704 (which only fixed the deprecation-horizon sed).
Ported from main
.github/workflows/release.yml—workflow_dispatchthat runsscript/releasewith major/minor/patch inputs and opens a release PR..github/workflows/publish-release.yml— triggers on push to3.x(or manual dispatch) and runsscript/publish..github/workflows/push_gem.yml— pushes the tagged gem to RubyGems via Trusted Publishing.script/release— includes every fix that landed on main:DEPRECATION_HORIZONsed handling the quoted string form.main "$@"so workflow args reachmain().BUNDLE_FROZEN=false/BUNDLE_DEPLOYMENT=falsefor the release run.bundle lockcross-Ruby lockfile mismatches onrails_main_head, once such appraisals are added).sync_contributors.rborrake docs:buildfails.script/publish— includes all main fixes:gh workflow run push_gem.yml --ref $tagaftergh release create(the tag push fromGITHUB_TOKENdoes not fire downstream workflows).script/sync_contributors.rb— used bybuild_docson main; brought over so the docs task is consistent.3.x-specific adjustments
publish-release.ymltriggers on push to3.x, notmain.script/releaseaccepts bothmainand3.xas valid release branches.branch_name(), so the same script cuts main-targeted PRs on main and 3.x-targeted PRs on 3.x.script/publishonly publishesgh-pageswhen run frommain. gh-pages hosts a single docs site — publishing from 3.x would clobber the current 4.x docs. 3.x still gets tagged and released — just no gh-pages update. Thegh release createandpush_gemdispatch both still fire on 3.x.Verification
bash -n script/releaseandbash -n script/publish: syntax OK.sedforMAJOR/MINOR/PATCHverified against 3.x'sversion.rb(which has the extraputsline at the bottom).mainreferences in the workflow YAML.docs/_data/library.ymlexists on 3.x;contributors.ymlwill be created bysync_contributors.rbon first release run beforegit add.Environments and secrets
For the workflows to work on 3.x, the same environment/secret configuration used on main is required:
releaseenvironment (used bypush_gem.yml) must permitv*tag refs — already the case for main.GITHUB_TOKENon the publish and release jobs already has the requiredcontents: write.