This repository uses Changesets for version management and changelog generation, with GitHub Actions publishing posthog-ruby and posthog-rails to RubyGems.
The gems have independent version numbers, but releases follow their dependency direction:
- A releasable change to
posthog-rubyneeds a changeset forposthog-ruby. Changesets automatically includes a Rails patch release to update its core SDK dependency. A Rails patch is appropriate when only its core SDK dependency changes and the update is backwards compatible, so Rails users receive the updated SDK. - A Rails-only change needs a changeset for
posthog-rails; it does not require aposthog-rubychangeset or release. - If both packages have code changes, select both and choose each package's release type based on its changes.
Changesets reads the workspace:* dependency in posthog-rails/package.json as an exact dependency on posthog-ruby and adds Rails to the release plan automatically.
When making changes that should be released, add a changeset:
pnpm changesetThis will prompt you to:
- select
posthog-rubyfor a core Ruby change,posthog-railsfor a Rails-only change, or both when both packages have code changes - select the release type (
patch,minor, ormajor) for each package - write a summary of the change
The changeset file will be created in the .changeset/ directory.
Create a PR with your code changes and the changeset file.
No release label is required. When the PR is merged to main, the release workflow will automatically:
- Check for pending changesets
- Notify the Client Libraries team in Slack for approval
- Wait for approval via the GitHub
Releaseenvironment - Once approved:
- Apply changesets and bump the changed package
package.jsonfiles - Update the changed package changelog (
posthog-ruby/CHANGELOG.mdorposthog-rails/CHANGELOG.md) - Sync package versions to the Ruby version files
- Commit the version bump to
main - Publish only the packages whose versions changed
- Create package-specific git tags and GitHub releases, for example
posthog-ruby-v3.13.1orposthog-rails-v3.14.0
- Apply changesets and bump the changed package
When both packages are released, the workflow publishes posthog-ruby first, then posthog-rails, since posthog-rails depends on posthog-ruby. The Rails gemspec pins its posthog-ruby dependency to the exact core SDK version present in the release commit. The automatically included Rails release updates that pin in the published Rails gem; a Rails-only release uses the core SDK version already recorded on main.
You can also manually trigger the release workflow from the Actions tab, as long as there are pending changesets.