This repo uses semantic-release with multi-semantic-release to version and publish all public workspaces. Tags follow ${name}-v${version} and releases are cut from master (stable) or any feature branch (prerelease).
- Secrets: npm trusted publishing (OIDC) is configured per-package on npmjs.com. The workflow uses
github.tokenfor GitHub operations. - Git history: full clone (
fetch-depth: 0) so semantic-release can find prior tags. - Commit format: conventional commits; commitlint is already configured.
- Config files:
release.config.js(single-package defaults) andmulti-release.config.js(multi-package orchestration, sequential init/prepare, ignore private packages, tag format/branches). - Plugins: commit analyzer + release notes, npm publish (with provenance), and GitHub release (no success comment).
- Script: root
yarn releaserunsmulti-semantic-releasewith the above config per public package.
- Ensure target branch is green. Merges must use conventional commits.
- Trigger
Releaseworkflow in Actions:- Production release: Run from
masterwith typeproduction→ publishes stable versions (e.g.,2.23.0) - Fix candidate/beta: Run from any feature branch with type
beta→ publishes prerelease versions (e.g.,2.23.0-fix-retry-bug.1) - Dry run: Run from any branch with type
dry-runto preview what would be published
- Production release: Run from
- Outputs: package tags (
${name}-vX.Y.Z), npm publishes, and GitHub releases.
Beta/fix candidate workflow:
- Push your feature branch (e.g.,
fix/customer-issue-123) - Run Release workflow from that branch with type
beta - Publishes with branch name in version:
2.23.0-fix-customer-issue-123.1 - Customer installs with:
npm install @segment/analytics-react-native@fix-customer-issue-123 - No branch management or syncing required
- Each feature branch gets its own npm dist-tag
Note: version bumps and changelogs are not committed back to the repo. The source of truth for versions is the git tags and npm registry. To sync the repo's package.json versions with npm, run devbox run sync-versions and include the changes in a PR.
GH_TOKEN=<token> devbox run release-dry-run(GH token needscontentsread).- Omit
--dry-runto actually publish (only do this if you intend to release from your machine; npm auth is handled via OIDC in CI).
- Only public packages release; private workspaces (e.g.,
packages/shared) are ignored. - Tag pattern is important: keep
${name}-v${version}if you create manual tags for debugging. - Branch name becomes part of prerelease identifier: use descriptive branch names (e.g.,
fix/retry-logicnotfix123). - Keep yarn.lock in sync before releasing to avoid install differences between CI and local.
.npmrccontainsworkspaces-update=falseto preventnpm versionfrom failing on Yarn'sworkspace:protocol.- Multiple fix candidates can coexist on npm simultaneously with different dist-tags.