@@ -24,16 +24,19 @@ Note: `chore/*` branches do not publish - they're for internal changes not meant
2424Since semantic-release now controls which branches can publish based on ` release.config.js ` , you can either:
2525
2626** Option A: Allow any branch** (Recommended)
27+
2728- Leave "Deployment branches and tags" set to "All branches"
2829- semantic-release will handle branch filtering
2930
3031** Option B: Restrict to specific patterns**
32+
3133- Select "Protected branches and tags only"
3234- Add patterns: ` fix/* ` , ` feat/* ` , ` beta `
3335
3436### 3. Add Required Reviewers (Optional)
3537
3638If you want manual approval before publishing:
39+
3740- Enable "Required reviewers"
3841- Add reviewers from your team
3942- Set wait timer if desired
@@ -45,12 +48,14 @@ The environment needs access to npm for publishing. You have two options:
4548#### Option A: npm Token (Traditional)
4649
47501 . Generate an npm automation token:
51+
4852 ``` bash
4953 npm login
5054 npm token create --type=automation
5155 ```
5256
53572 . Add the token as a secret:
58+
5459 - Click "Add secret"
5560 - Name: ` NPM_TOKEN `
5661 - Value: ` npm_xxx... ` (your automation token)
@@ -69,21 +74,25 @@ The environment needs access to npm for publishing. You have two options:
6974#### Option B: npm Provenance with OIDC (Recommended)
7075
7176The current setup uses npm provenance with OIDC, which doesn't require storing an NPM_TOKEN. This is more secure because:
77+
7278- No long-lived tokens to manage
7379- Automatic provenance attestation
7480- Built-in supply chain security
7581
7682**No additional npm setup needed!** The workflow already has:
83+
7784- ` id-token: write` permission
7885- `@semantic-release/npm` with `provenance : true`
7986
8087npm will automatically authenticate using GitHub's OIDC provider.
8188
8289**Requirements:**
90+
8391- The `@segment` npm organization must have publishing from GitHub Actions enabled
8492- The package must be public or the org must be on a paid npm plan
8593
8694To verify OIDC is configured :
95+
87961. Go to : https://www.npmjs.com/settings/segment/packages
88972. Check that "Publish" permissions include GitHub Actions
89983. If not, contact npm org admin to enable it
@@ -98,6 +107,7 @@ gh workflow run release.yml -f type=dry-run --ref fix/your-branch
98107` ` `
99108
100109This will :
110+
101111- Run CI checks
102112- Simulate the release process
103113- Show what would be published (without actually publishing)
@@ -110,6 +120,7 @@ gh workflow run release.yml -f type=prerelease --ref fix/your-branch
110120` ` `
111121
112122This will :
123+
113124- Run CI checks
114125- Run E2E tests
115126- Publish to npm with the appropriate dist-tag
@@ -144,8 +155,9 @@ npm install @segment/analytics-react-native@2.22.1-fix.1
144155# ## "semantic-release says no version will be published"
145156
146157Check that your branch name matches one of the configured patterns in `release.config.js` :
158+
147159- ` fix/*` - bug fixes for client distribution
148- - ` feat/*` - new features for client distribution
160+ - ` feat/*` - new features for client distribution
149161- ` beta` - explicit beta channel
150162- ` master` - production releases
151163- Version branches like `1.x` or `1.2.x` - maintenance releases
@@ -155,18 +167,21 @@ Note: `chore/*` branches intentionally don't publish as they're for internal cha
155167# ## "npm publish failed with 403"
156168
157169If using Option A (npm token) :
170+
158171- Verify `NPM_TOKEN` is set in the environment secrets
159172- Check the token has publish permissions : ` npm token list`
160173- Ensure the token hasn't expired
161174
162175If using Option B (OIDC) :
176+
163177- Verify the GitHub Actions OIDC provider is configured in npm org settings
164178- Check that `id-token : write` permission is set in the workflow
165179- Ensure `provenance : true` is set in semantic-release npm plugin config
166180
167181# ## "Environment branch policy blocking publish"
168182
169183If you set "Protected branches only" in the environment :
184+
170185- Make sure your branch pattern is added to the protection rules
171186- Or switch to "All branches" and rely on semantic-release filtering
172187
@@ -181,11 +196,13 @@ If you set "Protected branches only" in the environment:
181196# # Migrating from Old "Beta" Setup
182197
183198The old setup used `{ name : ' *' , prerelease: 'beta' }` which made ALL non-master branches publish as "beta". This was confusing because:
199+
184200- Fix branches weren't actually beta releases
185201- You couldn't have multiple prerelease channels
186202- The GitHub environment was called "Publish-Beta" but handled all prereleases
187203
188204The new setup is more explicit and semantically correct :
205+
189206- Each branch category gets its own channel
190207- The environment is now "Publish-Prerelease" to reflect its broader scope
191208- " beta" is now an explicit channel for the `beta` branch only
0 commit comments