This document describes how to release a new version of the PostHog Unity SDK.
Releases use changesets for version management and changelog generation:
- Add a changeset to your PR describing the change
- Add the
releaselabel to the PR - Merge the PR — GitHub Actions handles the rest
Run pnpm install to install dependencies.
When you make a change that should be included in the next release, add a changeset:
pnpm changesetThis will prompt you to:
- Select the package(s) affected (
com.posthog.unity) - Choose the semver bump type (patch/minor/major)
- Write a summary of the change
The changeset file is created in .changeset/ and should be committed with your PR.
Follow Semantic Versioning:
- patch: Bug fixes, backwards compatible
- minor: New features, backwards compatible
- major: Breaking changes
Include a changeset file in your PR (created via pnpm changeset).
Add the release label to the PR before or after merging.
When a PR with the release label is merged to main, the release workflow:
- Checks for pending changesets
- Sends a Slack notification requesting approval
- On approval:
- Applies changesets (bumps version, updates CHANGELOG.md)
- Syncs version to
com.posthog.unity/package.jsonandSdkInfo.Generated.cs - Commits the version bump to
main - Creates a git tag (
vX.Y.Z) - Creates a GitHub Release with auto-generated notes
You can also trigger the release workflow manually from the Actions tab via Run workflow.
Users can install specific versions via git URL:
# Latest
https://github.com/PostHog/posthog-unity.git?path=com.posthog.unity
# Specific version
https://github.com/PostHog/posthog-unity.git?path=com.posthog.unity#v0.1.0
The workflow only triggers when:
- A PR with the
releaselabel is merged tomain - Or manually via workflow_dispatch
Ensure your PR includes a changeset file in .changeset/. Run pnpm changeset to create one.
Go to Actions > Release and click Run workflow.