Skip to content

Latest commit

 

History

History
98 lines (60 loc) · 2.63 KB

File metadata and controls

98 lines (60 loc) · 2.63 KB

Releasing

This document describes how to release a new version of the PostHog Unity SDK.

Overview

Releases use changesets for version management and changelog generation:

  1. Add a changeset to your PR describing the change
  2. Add the release label to the PR
  3. Merge the PR — GitHub Actions handles the rest

Prerequisites

  • Node.js (see .nvmrc for version)
  • pnpm installed (npm install -g pnpm)

Run pnpm install to install dependencies.

Adding a Changeset

When you make a change that should be included in the next release, add a changeset:

pnpm changeset

This will prompt you to:

  1. Select the package(s) affected (com.posthog.unity)
  2. Choose the semver bump type (patch/minor/major)
  3. Write a summary of the change

The changeset file is created in .changeset/ and should be committed with your PR.

Version Guidelines

Follow Semantic Versioning:

  • patch: Bug fixes, backwards compatible
  • minor: New features, backwards compatible
  • major: Breaking changes

Release Process

1. Create your PR with a changeset

Include a changeset file in your PR (created via pnpm changeset).

2. Add the release label

Add the release label to the PR before or after merging.

3. Merge the PR

When a PR with the release label is merged to main, the release workflow:

  1. Checks for pending changesets
  2. Sends a Slack notification requesting approval
  3. On approval:
    • Applies changesets (bumps version, updates CHANGELOG.md)
    • Syncs version to com.posthog.unity/package.json and SdkInfo.Generated.cs
    • Commits the version bump to main
    • Creates a git tag (vX.Y.Z)
    • Creates a GitHub Release with auto-generated notes

Manual trigger

You can also trigger the release workflow manually from the Actions tab via Run workflow.

Version Pinning for Users

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

Troubleshooting

Release workflow didn't trigger

The workflow only triggers when:

  • A PR with the release label is merged to main
  • Or manually via workflow_dispatch

"No changesets found" error

Ensure your PR includes a changeset file in .changeset/. Run pnpm changeset to create one.

Need to re-run a failed release

Go to Actions > Release and click Run workflow.