pgbus is released with a single command: rake release[X.Y.Z]. It bumps the
version, verifies the gem builds, commits, pushes main, and creates the GitHub
Release. Creating that Release triggers .github/workflows/release.yml, which
re-runs the full test suite, rebuilds and verifies the gem, and publishes to
RubyGems via OIDC trusted publishing with a Sigstore attestation.
Nothing is published from a branch or a PR — a PR only stages the changelog
roll and any release-prep changes. The tag is cut from main by rake release.
Run these on main (or the branch you're about to merge and release):
-
bundle exec rakeis green (RuboCop + the full RSpec suite).release.ymlre-runs this on Ruby 3.3 and 3.4 before it will publish, so a red suite blocks the release — catch it locally first. -
CHANGELOG.md[Unreleased]holds every user-facing change since the last release.rake releasedoes not roll the changelog for you — roll it in the release-prep PR (see below) or as a commit onmainbefore releasing. -
bundle exec rake pgbus:pgmq:status— confirm the installed vs. vendored PGMQ schema version. If a newlib/pgbus/pgmq_schema/pgmq_v*.sqlwas vendored this cycle, the release notes should remind operators to runrails generate pgbus:upgrade_pgmqafter upgrading. -
docs/Gemfile.lockpinspgbus (X.Y.Z)matching the newlib/pgbus/version.rb. The docs site's frozenbundle installin CI fails if the lock drifts fromversion.rb. Re-pin withcd docs && bundle installand commit it in the release-prep PR. (rake releasebumpsversion.rbbut not the docs lock — keep them in sync yourself.) - Working directory is clean.
rake releaseaborts on any uncommitted change.
Version bumps land on main via rake release, but the changelog roll is a
reviewable change, so do it in a PR first:
- In
CHANGELOG.md, rename the top## [Unreleased]to## [X.Y.Z] - YYYY-MM-DD(today), and add a fresh empty## [Unreleased]above it with the standard category stubs (### Added,### Changed,### Fixed,### Security). Keep entries user-facing only — pure chore/test/docs-infra commits get no bullet. - Re-pin the docs lockfile:
cd docs && bundle install. - Commit both, open a PR, merge it once green.
Leave lib/pgbus/version.rb alone in this PR — rake release bumps it.
On a clean, up-to-date main:
rake release[X.Y.Z]That one task, in order:
- Aborts unless the working directory is clean.
- Updates
lib/pgbus/version.rbtoX.Y.Z(the single source of truth;release.ymlfails the publish if the tag andPgbus::VERSIONdisagree). - Runs
gem build pgbus.gemspec --strictas a local sanity check (and removes the built.gem). - Commits
chore: bump version to X.Y.Z. - Pushes to
origin/main. - Creates the GitHub Release
vX.Y.Zwithgh release create --generate-notes, which is what triggers the publish pipeline below.
You never run git tag, git push --tags, or gem push by hand — rake release
creates the tag+Release and the workflow owns publishing.
- Prerelease:
rake release[1.2.0.rc1]— a version matchingalpha|beta|rc|preis auto-detected and the GitHub Release is marked--prerelease.rake release[pre]cuts a prerelease of the currentversion.rbwithout bumping. - Re-cut a botched release:
rake release[X.Y.Z,force]— deletes the existingvX.Y.ZGitHub Release and tag (remote + local) first, then re-runs. Use only when a release failed partway and needs redoing; never to overwrite a release that already published to RubyGems.
Triggered by release: [published], the workflow runs these jobs in order:
-
test— runsbundle exec rakeon Ruby 3.3 and 3.4 (fail-fast), so a broken build blocks the publish. -
build(needstest) —- Tag/version consistency check: reads
Pgbus::VERSION, strips thevfrom the release tag, and fails the job if they differ. - Builds the gem with
gem build pgbus.gemspec --strict. - Gem-contents guard: unpacks the gem and fails if any
.git*file,*.gemspec, or aspec/testdirectory leaked into the package. - Generates SHA256/SHA512 checksums and uploads the gem + checksums as the
gemartifact.
- Tag/version consistency check: reads
-
publish-rubygems(needsbuild, environmentrubygems,id-token: write) —- Verifies the checksums.
- Configures RubyGems trusted publishing credentials via OIDC
(
rubygems/configure-rubygems-credentials) — no long-lived API token. - Signs the gem with
sigstore-cliand pushes withgem push --attestation(Sigstore attestation), then uploads the.sigstore.jsonbundle as thesigstoreartifact.
-
upload-release-assets(needsbuild+publish-rubygems,contents: write) — attaches the.gem, both checksum files, and the Sigstore bundle to the GitHub Release.
If any job fails, the gem is not published; fix the cause, then re-cut with
rake release[X.Y.Z,force].
- RubyGems trusted publishing must be configured for
pgbuson rubygems.org (therubygemsGitHub Environment is the trusted publisher). There is noRUBYGEMS_API_KEYsecret — OIDC replaces it. - Confirm the version appears on
rubygems.org/gems/pgbus and
release.ymlwent green. - The docs site (
pgbus.zoolutions.llc) deploys from its own workflow; a gem release does not redeploy docs. SLACK_WEBHOOK_URL— the dependency-watch workflow (.github/workflows/dependency-watch.yml, added by #287) posts to Slack when a watched upstream (pgmq-ruby, PGMQ) releases. Configure theSLACK_WEBHOOK_URLrepository secret so those notifications reach the team; without it the workflow degrades to a no-op notification step. Not part of the release flow itself.