|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document describes how to release a new version of cypress-playwright-on-rails. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Maintainer access to the repository |
| 8 | +2. RubyGems account with publish permissions for `cypress-on-rails` |
| 9 | +3. Clean working directory on `master` branch |
| 10 | +4. Development dependencies installed: `bundle install` |
| 11 | + - Includes `gem-release` for gem management (like react_on_rails) |
| 12 | + |
| 13 | +## Release Tasks |
| 14 | + |
| 15 | +The project uses rake tasks with `gem-release` to automate the release process (similar to react_on_rails and other ShakaCode gems): |
| 16 | + |
| 17 | +### Quick Release |
| 18 | + |
| 19 | +```bash |
| 20 | +# Prepare and publish in one command |
| 21 | +rake release:prepare[1.19.0] |
| 22 | +# Review changes, commit |
| 23 | +rake release:publish |
| 24 | +``` |
| 25 | + |
| 26 | +### Step-by-Step Release |
| 27 | + |
| 28 | +#### 1. Prepare the Release |
| 29 | + |
| 30 | +```bash |
| 31 | +rake release:prepare[1.19.0] |
| 32 | +``` |
| 33 | + |
| 34 | +This task will: |
| 35 | +- Validate the version format (X.Y.Z) |
| 36 | +- Update `lib/cypress_on_rails/version.rb` |
| 37 | +- Update `CHANGELOG.md` with the new version and date |
| 38 | +- Provide next steps |
| 39 | + |
| 40 | +After running this: |
| 41 | +```bash |
| 42 | +# Review the changes |
| 43 | +git diff |
| 44 | + |
| 45 | +# Commit the version bump |
| 46 | +git add -A |
| 47 | +git commit -m "Bump version to 1.19.0" |
| 48 | + |
| 49 | +# Push to master |
| 50 | +git push origin master |
| 51 | +``` |
| 52 | + |
| 53 | +#### 2. Publish the Release |
| 54 | + |
| 55 | +```bash |
| 56 | +rake release:publish |
| 57 | +``` |
| 58 | + |
| 59 | +This task will: |
| 60 | +- Verify you're on master branch |
| 61 | +- Verify working directory is clean |
| 62 | +- Run the test suite |
| 63 | +- Use bundler's built-in `rake release` to: |
| 64 | + - Create a git tag (e.g., `v1.19.0`) |
| 65 | + - Build the gem |
| 66 | + - Push the gem to RubyGems |
| 67 | + - Push the tag to GitHub |
| 68 | + |
| 69 | +#### 3. Post-Release Steps |
| 70 | + |
| 71 | +After publishing, complete these manual steps: |
| 72 | + |
| 73 | +1. **Create GitHub Release** |
| 74 | + - Go to https://github.com/shakacode/cypress-playwright-on-rails/releases/new?tag=v1.19.0 |
| 75 | + - Copy release notes from CHANGELOG.md |
| 76 | + - Publish the release |
| 77 | + |
| 78 | +2. **Announce the Release** |
| 79 | + - Post in Slack channel |
| 80 | + - Tweet about the release |
| 81 | + - Update forum posts if needed |
| 82 | + |
| 83 | +3. **Close Related Issues** |
| 84 | + - Review issues addressed in this release |
| 85 | + - Close them with reference to the release |
| 86 | + |
| 87 | +## Version Numbering |
| 88 | + |
| 89 | +Follow [Semantic Versioning](https://semver.org/): |
| 90 | + |
| 91 | +- **MAJOR** (X.0.0): Breaking changes |
| 92 | +- **MINOR** (1.X.0): New features, backwards compatible |
| 93 | +- **PATCH** (1.19.X): Bug fixes, backwards compatible |
| 94 | + |
| 95 | +### Examples |
| 96 | + |
| 97 | +```bash |
| 98 | +# Patch release (bug fixes) |
| 99 | +rake release:prepare[1.18.1] |
| 100 | + |
| 101 | +# Minor release (new features) |
| 102 | +rake release:prepare[1.19.0] |
| 103 | + |
| 104 | +# Major release (breaking changes) |
| 105 | +rake release:prepare[2.0.0] |
| 106 | +``` |
| 107 | + |
| 108 | +## Pre-Release Checklist |
| 109 | + |
| 110 | +Before running `rake release:prepare`: |
| 111 | + |
| 112 | +- [ ] All PRs for the release are merged |
| 113 | +- [ ] CI is passing on master |
| 114 | +- [ ] CHANGELOG.md has [Unreleased] section with all changes |
| 115 | +- [ ] Major changes have been tested manually |
| 116 | +- [ ] Documentation is up to date |
| 117 | +- [ ] Issue #183 discussion is resolved (if applicable) |
| 118 | + |
| 119 | +## Troubleshooting |
| 120 | + |
| 121 | +### "Must be on master branch" error |
| 122 | + |
| 123 | +```bash |
| 124 | +git checkout master |
| 125 | +git pull --rebase |
| 126 | +``` |
| 127 | + |
| 128 | +### "Working directory is not clean" error |
| 129 | + |
| 130 | +```bash |
| 131 | +# Commit or stash your changes |
| 132 | +git status |
| 133 | +git add -A && git commit -m "Your message" |
| 134 | +# or |
| 135 | +git stash |
| 136 | +``` |
| 137 | + |
| 138 | +### "Tests failed" error |
| 139 | + |
| 140 | +```bash |
| 141 | +# Fix the failing tests before releasing |
| 142 | +bundle exec rake spec |
| 143 | + |
| 144 | +# If tests are truly failing, don't release |
| 145 | +``` |
| 146 | + |
| 147 | +### "Failed to push gem to RubyGems" error |
| 148 | + |
| 149 | +Ensure you're authenticated with RubyGems: |
| 150 | +```bash |
| 151 | +gem signin |
| 152 | +# Enter your RubyGems credentials |
| 153 | +``` |
| 154 | + |
| 155 | +### Tag already exists |
| 156 | + |
| 157 | +If you need to re-release: |
| 158 | +```bash |
| 159 | +# Delete local tag |
| 160 | +git tag -d v1.19.0 |
| 161 | + |
| 162 | +# Delete remote tag |
| 163 | +git push origin :v1.19.0 |
| 164 | + |
| 165 | +# Try again |
| 166 | +rake release:publish |
| 167 | +``` |
| 168 | + |
| 169 | +## Rollback |
| 170 | + |
| 171 | +If you need to rollback a release: |
| 172 | + |
| 173 | +### Yank the gem from RubyGems |
| 174 | +```bash |
| 175 | +gem yank cypress-on-rails -v 1.19.0 |
| 176 | +``` |
| 177 | + |
| 178 | +### Delete the git tag |
| 179 | +```bash |
| 180 | +git tag -d v1.19.0 |
| 181 | +git push origin :v1.19.0 |
| 182 | +``` |
| 183 | + |
| 184 | +### Revert the version commit |
| 185 | +```bash |
| 186 | +git revert HEAD |
| 187 | +git push origin master |
| 188 | +``` |
| 189 | + |
| 190 | +## Example Release Flow |
| 191 | + |
| 192 | +```bash |
| 193 | +# 1. Ensure you're on master and up to date |
| 194 | +git checkout master |
| 195 | +git pull --rebase |
| 196 | + |
| 197 | +# 2. Prepare the release |
| 198 | +rake release:prepare[1.19.0] |
| 199 | +# Review output, confirm with 'y' |
| 200 | + |
| 201 | +# 3. Review and commit changes |
| 202 | +git diff |
| 203 | +git add -A |
| 204 | +git commit -m "Bump version to 1.19.0" |
| 205 | + |
| 206 | +# 4. Run tests (optional, publish will run them too) |
| 207 | +bundle exec rake spec |
| 208 | + |
| 209 | +# 5. Push to master |
| 210 | +git push origin master |
| 211 | + |
| 212 | +# 6. Publish the release |
| 213 | +rake release:publish |
| 214 | + |
| 215 | +# 7. Create GitHub release |
| 216 | +open "https://github.com/shakacode/cypress-playwright-on-rails/releases/new?tag=v1.19.0" |
| 217 | + |
| 218 | +# 8. Celebrate! 🎉 |
| 219 | +``` |
| 220 | + |
| 221 | +## Notes |
| 222 | + |
| 223 | +- The release tasks will **not** push commits to master for you |
| 224 | +- Always review changes before committing |
| 225 | +- The `publish` task will run tests before releasing |
| 226 | +- Tags are created locally first, then pushed |
| 227 | +- Failed releases can be retried after fixing issues |
0 commit comments