PostHog Code uses semantic versioning with git tags. Patch versions are automatically computed from commit counts.
The version in apps/code/package.json is set to 0.0.0-dev - this is intentional. CI injects the real version at build time from git tags.
- major.minor: Controlled by git tags (e.g.,
v0.15.0,v1.0.0) - patch: Auto-calculated as number of commits since the minor tag
Important: Releases must use proper three-part semver versions (e.g., v0.22.1, not v0.22). The Electron auto-updater uses update.electronjs.org, which requires valid semver for version comparison. Two-part versions will break auto-updates.
- A base tag like
v0.15.0marks the start of a minor version - Each push to
maintriggers a release with version0.15.Nwhere N = commits sincev0.15.0 - No manual
package.jsonupdates needed for patch releases
Just push to main. The workflow computes the version automatically:
v0.15.0 tag exists
Push commit #1 → releases 0.15.1
Push commit #2 → releases 0.15.2
Push commit #3 → releases 0.15.3
Create a new base tag when you want to bump the minor version:
git tag v0.16.0
git push origin v0.16.0The next push to main will release 0.16.1.
Same process, just increment the major:
git tag v1.0.0
git push origin v1.0.0See what version would be released:
# Find the current base tag
git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.0$' | head -1
# Count commits since base tag (this is the patch number)
git rev-list v0.15.0..HEAD --count- Base tags (manual):
vX.Y.0- e.g.,v0.15.0,v1.0.0 - Release tags (auto):
vX.Y.Z- e.g.,v0.15.3, created by CI
Only base tags (vX.Y.0) are used for version calculation. Release tags (vX.Y.Z) are created for GitHub releases but ignored when computing the next version.