Repository navigation
Conversation
Pull requests are squash merged with the PR title as the commit message. Conventional titles make that history usable by release-please, which is the planned way to generate the changelog and cut releases. Dependabot titles get a ci prefix so they pass the check, and the stale release instructions in the README now point to CONTRIBUTING.
Releasing took a version bump after every release, a changelog row in every pull request, and a hand-made tag and GitHub release. release-please does all of it from the pull request titles, which jwt#799 requires to follow Conventional Commits. It keeps a release pull request open, and merging it tags the release, creates the GitHub release and publishes the gem. The manifest starts at 3.3.1, the last release made the old way. lib/jwt/version.rb keeps its MAJOR, MINOR and TINY constants, which the Ruby updater does not rewrite, so the lines carry the generic updater's annotations instead. The changelog sections keep the Features and Fixes and enhancements headings, and hide refactor, docs, test, ci, build and chore pull requests. The release job calls push_gem.yml rather than publishing itself, so the tag check, build, push and wait steps stay in one place. A tag created with GITHUB_TOKEN does not trigger other workflows, so the call is what publishes it. push_gem.yml checks out and verifies the given tag, since GITHUB_REF_NAME is main when it is called. It can also be run by hand to publish an existing tag again. The tag trigger stays for 2.x, which is still released by hand from 2-10-stable. CONTRIBUTING.md and the pull request template drop the changelog row, and the release section describes the new process. Refs jwt#785
1 of 2 tasks
This branch has not been deployed
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.
Description
Implements the plan in #785. It depends on #799 (the PR title check) and includes its commit until that's merged, so review only the second commit.
Releasing has meant bumping the version after every release, adding a changelog row in every PR, and tagging and creating the GitHub release by hand. With release-please, a release PR stays open and is updated after each merge to
main. Merging it tags the release, creates the GitHub release and publishes the gem. The setup followsanakinj/jwk-loader, which published 1.3.0 this way.Config
release-please-config.jsonusesrelease-type: ruby. Tags stayvX.Y.Z(include-v-in-tag, andinclude-component-in-tag: false, because otherwisepackage-nameturns tags intojwt-v3.4.0).featgoes under Features, andfixandperfunder Fixes and enhancements.revertgets its own section.refactor,docs,test,ci,buildandchoreare hidden..release-please-manifest.jsonstarts at 3.3.1, the last release made the old way.lib/jwt/version.rbkeeps itsMAJOR/MINOR/TINYconstants. The Ruby updater only rewritesVERSION = "x.y.z", so those lines carryx-release-please-major/minor/patchannotations and the file is also listed underextra-files.Publishing
release-please.ymlruns release-please on pushes tomain. When a release is created, it callspush_gem.ymlwith the new tag. A tag created withGITHUB_TOKENdoesn't trigger other workflows, so the call is what publishes it.push_gem.ymlgetsworkflow_callandworkflow_dispatchtriggers with ataginput. It checks out and verifiesrefs/tags/<tag>, sinceGITHUB_REF_NAMEismainwhen it's called. The build, push and wait steps are unchanged. Running it by hand re-publishes an existing tag if publishing fails. The tag trigger stays, because 2.x is still released by hand from2-10-stable.Docs
CONTRIBUTING.mdand the PR template drop the changelog row. The release section now describes release-please, with a short manual procedure for 2.x.Verification
release-please release-pr --dry-runagainst a throwaway copy of this branch with an emptyfix:andfeat:commit, withlast-release-shaset to the v3.3.1 commit. That setting was only on the throwaway branch, because the fork has no v3.3.1 release. It would openchore(...): release 3.4.0, which passes the ci: Check that PR titles follow Conventional Commits #799 title check, with tagv3.4.0, a compare link tov3.3.1, and both entries under the right headings.version.rbandCHANGELOG.mdlocally. 3.3.2, 3.4.0 and 4.0.0 rewrite the constants correctly, and the new section goes abovev3.3.1under# Changelog.version.rbstill loads as 3.3.1.Before merging
RUBYGEMS_PUSH_ROLEallows publishing whenpush_gem.ymlis called fromrelease-please.ymlonmain, not only on tag refs.GITHUB_TOKEN, so no workflows run on them. If the PR title check or the tests become required status checks onmain, release PRs can't be merged without an admin override. The alternative is a GitHub App token for release-please.After merging
The first
feat/fixPR merged opens the first release PR. Merging that confirms the tag, the GitHub release and the gem.Refs #785
Posted by Claude on behalf of @anakinj.