Skip to content

ci: Release with release-please - #800

Open
anakinj wants to merge 2 commits into
jwt:mainfrom
anakinj:ci/release-please
Open

anakinj wants to merge 2 commits into
jwt:mainfrom
anakinj:ci/release-please

Conversation

@anakinj

@anakinj anakinj commented Nov 24, 2026

Copy link
Copy Markdown
Member

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 follows anakinj/jwk-loader, which published 1.3.0 this way.

Config

  • release-please-config.json uses release-type: ruby. Tags stay vX.Y.Z (include-v-in-tag, and include-component-in-tag: false, because otherwise package-name turns tags into jwt-v3.4.0).
  • Changelog sections: feat goes under Features, and fix and perf under Fixes and enhancements. revert gets its own section. refactor, docs, test, ci, build and chore are hidden.
  • .release-please-manifest.json starts at 3.3.1, the last release made the old way.
  • lib/jwt/version.rb keeps its MAJOR/MINOR/TINY constants. The Ruby updater only rewrites VERSION = "x.y.z", so those lines carry x-release-please-major/minor/patch annotations and the file is also listed under extra-files.

Publishing

  • release-please.yml runs release-please on pushes to main. When a release is created, it calls push_gem.yml with the new tag. A tag created with GITHUB_TOKEN doesn't trigger other workflows, so the call is what publishes it.
  • push_gem.yml gets workflow_call and workflow_dispatch triggers with a tag input. It checks out and verifies refs/tags/<tag>, since GITHUB_REF_NAME is main when 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 from 2-10-stable.

Docs

CONTRIBUTING.md and the PR template drop the changelog row. The release section now describes release-please, with a short manual procedure for 2.x.

Verification

  • Dry run: I ran release-please release-pr --dry-run against a throwaway copy of this branch with an empty fix: and feat: commit, with last-release-sha set 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 open chore(...): release 3.4.0, which passes the ci: Check that PR titles follow Conventional Commits #799 title check, with tag v3.4.0, a compare link to v3.3.1, and both entries under the right headings.
  • Updaters: I ran release-please 17's updaters on version.rb and CHANGELOG.md locally. 3.3.2, 3.4.0 and 4.0.0 rewrite the constants correctly, and the new section goes above v3.3.1 under # Changelog.
  • Specs and RuboCop: both pass. version.rb still loads as 3.3.1.

Before merging

  • RubyGems trusted publishing: check that the role behind RUBYGEMS_PUSH_ROLE allows publishing when push_gem.yml is called from release-please.yml on main, not only on tag refs.
  • Required checks: release PRs are opened with GITHUB_TOKEN, so no workflows run on them. If the PR title check or the tests become required status checks on main, 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/fix PR 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.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant