|
12 | 12 | - [Creating Pull Requests](#creating-pull-requests) |
13 | 13 | - [Title](#title) |
14 | 14 | - [Description](#description) |
| 15 | +- [Publishing](#publishing) |
| 16 | + - [v2](#v2) |
| 17 | + - [v1 (legacy)](#v1-legacy) |
15 | 18 |
|
16 | 19 | ## Setting Up Your Environment |
17 | 20 |
|
@@ -148,4 +151,69 @@ When creating PR descriptions, start it with a section on one-line Customer Impa |
148 | 151 | * `Deprecated` for soon-to-be removed features. |
149 | 152 | * `Removed` for now removed features. |
150 | 153 | * `Fixed` for any bug fixes. |
151 | | -* `Security` in case of vulnerabilities. |
| 154 | +* `Security` in case of vulnerabilities. |
| 155 | +
|
| 156 | +## Publishing |
| 157 | +
|
| 158 | +### v2 |
| 159 | +
|
| 160 | +To publish a new version of the v2 SDK: |
| 161 | +
|
| 162 | +1. **Ensure your changes are merged into the `main` branch** |
| 163 | + - All v2 SDK changes must be merged into the main branch |
| 164 | +
|
| 165 | +2. **Run the publish GitHub Action** |
| 166 | + - Go to Actions tab in the repository |
| 167 | + - Select the "Publish to NPM" workflow |
| 168 | + - Click "Run workflow" |
| 169 | + - Select the `main` branch |
| 170 | + - Choose the appropriate release type: |
| 171 | + - `prerelease`: Increments the prerelease version (e.g., 2.0.0-alpha.1 → 2.0.0-alpha.2) |
| 172 | + - `prepatch`: Increments the patch version and adds prerelease suffix (e.g., 2.0.0 → 2.0.1-alpha.0) |
| 173 | + - `preminor`: Increments the minor version and adds prerelease suffix (e.g., 2.0.0 → 2.1.0-alpha.0) |
| 174 | + - `premajor`: Increments the major version and adds prerelease suffix (e.g., 2.0.0 → 3.0.0-alpha.0) |
| 175 | + - `patch`: Increments the patch version (e.g., 2.0.0 → 2.0.1) |
| 176 | + - `minor`: Increments the minor version (e.g., 2.0.0 → 2.1.0) |
| 177 | + - `major`: Increments the major version (e.g., 2.0.0 → 3.0.0) |
| 178 | + - Note: Major version releases can only be performed by administrators or authorized SDK team members |
| 179 | + - Optionally check "Dry run" to simulate the publishing process without actually publishing |
| 180 | + - Click "Run workflow" |
| 181 | +
|
| 182 | +3. **Monitor the workflow execution** |
| 183 | + - The workflow will build the SDK, generate version files, create a GitHub release (for non-prerelease versions), and publish to npm |
| 184 | + - If successful, Slack notifications will be sent to the SDK team |
| 185 | + - The CDN cache will be purged for non-prerelease versions to ensure the latest version is available |
| 186 | +
|
| 187 | +Note: Prerelease versions are published with the `alpha` tag on npm, while regular releases are published with the `latest` tag. |
| 188 | +
|
| 189 | +### v1 (legacy) |
| 190 | +
|
| 191 | +The v1 SDK is maintained in the `legacy-v1` branch and uses a different publishing process. |
| 192 | +
|
| 193 | +To publish a new version of the v1 SDK: |
| 194 | +
|
| 195 | +1. **Ensure your changes are merged into the `legacy-v1` branch** |
| 196 | + - All v1 SDK changes must be merged into the legacy-v1 branch |
| 197 | +
|
| 198 | +2. **Run the publish GitHub Action** |
| 199 | + - Go to Actions tab in the repository |
| 200 | + - Select the "Publish to NPM" workflow |
| 201 | + - Click "Run workflow" |
| 202 | + - Select the `legacy-v1` branch |
| 203 | + - Choose the appropriate release type: |
| 204 | + - `alpha`: Publishes a prerelease version with the "alpha-legacy" tag |
| 205 | + - `release`: Publishes a stable release with the "legacy" tag |
| 206 | + - Choose the appropriate upgrade type: |
| 207 | + - `none`: Only increments the revision for alpha releases, no change for stable releases |
| 208 | + - `patch`: Increments the patch version (e.g., 1.0.0 → 1.0.1) |
| 209 | + - `minor`: Increments the minor version (e.g., 1.0.0 → 1.1.0) |
| 210 | + - Optionally check "Dry run" to simulate the publishing process without actually publishing |
| 211 | + - Click "Run workflow" |
| 212 | +
|
| 213 | +3. **Monitor the workflow execution** |
| 214 | + - The workflow will validate the version (ensuring it starts with "1."), run tests, build the SDK, and publish to npm |
| 215 | + - For stable releases, it will also create a GitHub release and purge the CDN cache |
| 216 | + - If successful, Slack notifications will be sent to the SDK team |
| 217 | +
|
| 218 | +Note: The v1 SDK publish workflow will only accept version numbers that start with "1." to ensure it publishes legacy versions. |
| 219 | +
|
0 commit comments