You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add npm authentication pre-flight check to release script (#2207)
## Summary
Fixes#2206
The release script now verifies npm authentication at the start, before
making any version bumps or git operations. This prevents partially
completed releases when npm tokens have expired.
- Add `verify_npm_auth` function that runs `npm whoami` to check
authentication
- Call it early in the release task, before any changes are made
- Skip the check for Verdaccio (local registry) and dry runs
- Update docs with pre-release checklist and troubleshooting section
## Test plan
- [ ] Test with valid npm credentials: `rake release[patch,true]` (dry
run) should show "✓ Logged in to NPM as: username"
- [ ] Test with expired/missing credentials: `npm logout && rake
release[patch,true]` should abort with clear error message
- [ ] Test with Verdaccio: `rake release[patch,true,verdaccio]` should
skip npm auth check
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a Pre-Release Checklist, reordered release steps to verify NPM
auth earlier, and expanded NPM authentication guidance (token/2FA notes)
plus troubleshooting for expired tokens and re-login.
* **Chores**
* Release now performs pre-flight NPM auth checks with an automatic
login attempt; the auth check is skipped when a local registry is used
to avoid false failures.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/contributor-info/releasing.md
+34-12Lines changed: 34 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,23 +91,35 @@ For pre-release versions, the gem version format is automatically converted to N
91
91
- Gem: `3.0.0.beta.1`
92
92
- NPM: `3.0.0-beta.1`
93
93
94
+
### Pre-Release Checklist
95
+
96
+
Before running the release command, verify:
97
+
98
+
1.**NPM authentication**: Run `npm whoami` to confirm you're logged in
99
+
- If not logged in, the release script will automatically run `npm login` for you
100
+
101
+
2.**RubyGems authentication**: Ensure you have valid credentials for `gem push`
102
+
103
+
3.**No uncommitted changes**: Run `git status` to verify clean working tree
104
+
94
105
### Release Process
95
106
96
107
When you run `rake release[X.Y.Z]`, the task will:
97
108
98
109
1. Check for uncommitted changes (will abort if found)
99
-
2. Pull latest changes from the remote repository
100
-
3. Clean up example directories
101
-
4. Bump the gem version in `lib/react_on_rails/version.rb`
102
-
5. Update all package.json files with the new version
103
-
6. Update the Pro package's dependency on react-on-rails
104
-
7. Update the dummy app's Gemfile.lock
105
-
8. Commit all version changes with message "Bump version to X.Y.Z"
106
-
9. Create a git tag `vX.Y.Z`
107
-
10. Push commits and tags to the remote repository
108
-
11. Publish `react-on-rails` to NPM (requires 2FA token)
109
-
12. Publish `react-on-rails-pro` to NPM (requires 2FA token)
110
-
13. Publish `react_on_rails` to RubyGems (requires 2FA token)
110
+
2. Verify NPM authentication (will run `npm login` if needed)
111
+
3. Pull latest changes from the remote repository
112
+
4. Clean up example directories
113
+
5. Bump the gem version in `lib/react_on_rails/version.rb`
114
+
6. Update all package.json files with the new version
115
+
7. Update the Pro package's dependency on react-on-rails
116
+
8. Update the dummy app's Gemfile.lock
117
+
9. Commit all version changes with message "Bump version to X.Y.Z"
118
+
10. Create a git tag `vX.Y.Z`
119
+
11. Push commits and tags to the remote repository
120
+
12. Publish `react-on-rails` to NPM (requires 2FA token)
121
+
13. Publish `react-on-rails-pro` to NPM (requires 2FA token)
122
+
14. Publish `react_on_rails` to RubyGems (requires 2FA token)
111
123
112
124
### Two-Factor Authentication
113
125
@@ -232,6 +244,16 @@ rake release[16.2.0,true]
232
244
233
245
This shows you exactly what would be updated without making any changes.
234
246
247
+
### NPM Authentication Issues
248
+
249
+
If you see errors like "Access token expired" or "E404 Not Found" during NPM publish:
250
+
251
+
1. Your NPM token has expired (tokens now expire after 90 days)
252
+
2. Run `npm login` to refresh your credentials
253
+
3. Retry the release
254
+
255
+
The release script now checks NPM authentication at the start and will automatically run `npm login` if needed, so this issue will be caught and handled before any changes are made.
256
+
235
257
### If Release Fails
236
258
237
259
If the release fails partway through (e.g., during NPM publish):
0 commit comments