|
| 1 | +# Tag Release TUI |
| 2 | + |
| 3 | +A terminal user interface (TUI) for creating GitHub releases using Charmbracelet's Bubbletea library. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```bash |
| 8 | +# Build the application |
| 9 | +go build -o tag-release-tui ./cmd/tag-release-tui |
| 10 | + |
| 11 | +# Run with a version tag |
| 12 | +./tag-release-tui v1.2.3 |
| 13 | + |
| 14 | +# Run in test mode (validation only, no actual changes) |
| 15 | +./tag-release-tui v1.2.3 --test |
| 16 | + |
| 17 | +# Or use the convenience script |
| 18 | +./run-tag-release-tui.sh v1.2.3 --test |
| 19 | +``` |
| 20 | + |
| 21 | +## Features |
| 22 | + |
| 23 | +- **Interactive Validation**: Shows real-time validation of release requirements |
| 24 | +- **Test Mode**: Run with `--test` flag to validate without making any actual changes |
| 25 | +- **Flexible Branch Support**: Can be configured to work with any branch (currently set to `tag-release-charmbracelet`) |
| 26 | +- **Confirmation Screen**: Displays a summary and asks for confirmation before proceeding |
| 27 | +- **Live Execution**: Shows progress as the release is being created |
| 28 | +- **Post-Release Instructions**: Provides next steps after successful release creation |
| 29 | + |
| 30 | +## Flow |
| 31 | + |
| 32 | +1. **Validation Phase**: |
| 33 | + - Checks tag format (semantic versioning) |
| 34 | + - Verifies you're on the main branch |
| 35 | + - Fetches latest changes |
| 36 | + - Checks working directory is clean |
| 37 | + - Validates branch is up-to-date |
| 38 | + - Ensures tag doesn't already exist |
| 39 | + |
| 40 | +2. **Confirmation Phase**: |
| 41 | + - Shows release summary |
| 42 | + - Lists actions that will be performed |
| 43 | + - Prompts for confirmation (y/n) |
| 44 | + |
| 45 | +3. **Execution Phase**: |
| 46 | + - Creates the release tag |
| 47 | + - Pushes tag to origin |
| 48 | + - Updates latest-release tag |
| 49 | + - Pushes latest-release tag |
| 50 | + |
| 51 | +4. **Completion Phase**: |
| 52 | + - Shows success message |
| 53 | + - Provides post-release instructions |
| 54 | + - Shows relevant links |
| 55 | + |
| 56 | +## Keyboard Controls |
| 57 | + |
| 58 | +- `y` - Confirm release creation (or test simulation) |
| 59 | +- `n` - Cancel release creation |
| 60 | +- `q` or `Ctrl+C` - Quit at any time |
| 61 | +- `Enter` - Exit after completion or error |
| 62 | + |
| 63 | +## Test Mode |
| 64 | + |
| 65 | +Use the `--test` flag to run the application in test mode: |
| 66 | + |
| 67 | +```bash |
| 68 | +./tag-release-tui v1.2.3 --test |
| 69 | +``` |
| 70 | + |
| 71 | +In test mode, the application will: |
| 72 | +- Perform all validation checks |
| 73 | +- Show the confirmation screen with simulated actions |
| 74 | +- Complete without making any actual git operations |
| 75 | +- Display a test results summary |
| 76 | + |
| 77 | +This is perfect for: |
| 78 | +- Testing the application functionality |
| 79 | +- Validating release requirements without risk |
| 80 | +- Training or demonstration purposes |
| 81 | +- CI/CD validation workflows |
| 82 | + |
| 83 | +## Error Handling |
| 84 | + |
| 85 | +The application will show detailed error messages if any validation step fails, such as: |
| 86 | +- Invalid tag format |
| 87 | +- Not on main branch |
| 88 | +- Uncommitted changes |
| 89 | +- Out-of-date branch |
| 90 | +- Tag already exists |
| 91 | + |
| 92 | +## Comparison with Original Script |
| 93 | + |
| 94 | +This TUI version provides the same functionality as the original `script/tag-release` but with: |
| 95 | +- Better visual feedback |
| 96 | +- Interactive confirmation |
| 97 | +- Real-time progress updates |
| 98 | +- Improved error presentation |
| 99 | +- Built-in test mode (no need for `--dry-run` flag) |
| 100 | +- Support for different branches during development |
| 101 | +- Enhanced user experience with modern terminal UI |
| 102 | + |
| 103 | +## Configuration |
| 104 | + |
| 105 | +Currently configured for: |
| 106 | +- **Allowed Branch**: `tag-release-charmbracelet` (for development/testing) |
| 107 | +- **Target Branch**: Can be modified in the source code for production use |
| 108 | + |
| 109 | +To use with the main branch in production, change the `allowedBranch` parameter in the `performValidation` call. |
0 commit comments