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