Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ jobs:
fetch-depth: 0
token: ${{ github.token }}

- name: Point beta branch at current commit
if: inputs.type == 'beta'
run: |
git checkout -B beta HEAD
git push origin beta --force

- name: Install devbox
uses: jetify-com/devbox-install-action@v0.14.0

Expand All @@ -70,7 +64,9 @@ jobs:

- name: Release (beta)
if: inputs.type == 'beta'
run: devbox run -e GITHUB_REF=refs/heads/beta release
run: |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
devbox run -e GITHUB_REF=refs/heads/$BRANCH_NAME release
env:
GH_TOKEN: ${{ github.token }}

Expand Down
6 changes: 5 additions & 1 deletion multi-release.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
branches: ['master', { name: 'beta', prerelease: true }],
branches: [
'master',
{ name: '+([0-9])?(.{+([0-9]),x}).x', prerelease: true }, // support branches (e.g., 1.x, 1.2.x)
{ name: '*', prerelease: true }, // any other branch = prerelease
],
tagFormat: '${name}-v${version}',
deps: {
bump: 'satisfy', // Do not trigger a release for every package if the only change is a minor/patch upgrade of dependencies
Expand Down
6 changes: 5 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
branches: ['master', { name: 'beta', prerelease: true }],
branches: [
'master',
{ name: '+([0-9])?(.{+([0-9]),x}).x', prerelease: true }, // support branches (e.g., 1.x, 1.2.x)
{ name: '*', prerelease: true }, // any other branch = prerelease
],
tagFormat: '${name}-v${version}',
plugins: [
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
Expand Down
21 changes: 17 additions & 4 deletions wiki/release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Release guide

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) and `beta` (prerelease).
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).

### Prerequisites

Expand All @@ -16,10 +16,22 @@ This repo uses semantic-release with multi-semantic-release to version and publi

### CI/CD path (recommended)

1. Ensure `master`/`beta` are green. Merges must use conventional commits.
2. Trigger `Release` workflow in Actions. Choose type: `dry-run`, `beta`, or `production`.
1. Ensure target branch is green. Merges must use conventional commits.
2. Trigger `Release` workflow in Actions:
- **Production release**: Run from `master` with type `production` → 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-run` to preview what would be published
3. 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 --config=shells/devbox-fast.json sync-versions` and include the changes in a PR.

### Local dry run
Expand All @@ -31,6 +43,7 @@ Note: version bumps and changelogs are **not** committed back to the repo. The s

- 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.
- If adding a new branch for releases, update both `release.config.js` and `multi-release.config.js`.
- Branch name becomes part of prerelease identifier: use descriptive branch names (e.g., `fix/retry-logic` not `fix123`).
- Keep yarn.lock in sync before releasing to avoid install differences between CI and local.
- `.npmrc` contains `workspaces-update=false` to prevent `npm version` from failing on Yarn's `workspace:` protocol.
- Multiple fix candidates can coexist on npm simultaneously with different dist-tags.
Loading