|
| 1 | +# Changelog Automation with Taskfile |
| 2 | + |
| 3 | +This project uses [Task](https://taskfile.dev/) to automate changelog generation for releases. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. **Install Task**: |
| 8 | + ```bash |
| 9 | + # macOS |
| 10 | + brew install go-task/tap/go-task |
| 11 | + |
| 12 | + # Or download from https://taskfile.dev/installation/ |
| 13 | + ``` |
| 14 | + |
| 15 | +2. **Install dependencies**: |
| 16 | + ```bash |
| 17 | + # GitHub CLI |
| 18 | + brew install gh |
| 19 | + |
| 20 | + # jq for JSON processing |
| 21 | + brew install jq |
| 22 | + |
| 23 | + # python3 (usually pre-installed on macOS) |
| 24 | + python3 --version |
| 25 | + ``` |
| 26 | + |
| 27 | +3. **Authenticate with GitHub**: |
| 28 | + ```bash |
| 29 | + gh auth login |
| 30 | + ``` |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +### Generate Changelog for New Release |
| 35 | + |
| 36 | +```bash |
| 37 | +# Generate changelog for version 0.8.0 |
| 38 | +task generate-changelog VERSION=0.8.0 |
| 39 | + |
| 40 | +# Generate changelog with more PRs (default is 10) |
| 41 | +task generate-changelog VERSION=0.8.0 LIMIT=20 |
| 42 | +``` |
| 43 | + |
| 44 | +This will: |
| 45 | +1. Fetch the last 10 (or specified number) of merged PRs |
| 46 | +2. Categorize them into Added/Fixed/Dependencies sections |
| 47 | +3. Update `CHANGELOG.md` with the new version |
| 48 | +4. Update `src/main/resources/META-INF/plugin.xml` change-notes section |
| 49 | +5. Extract unique contributors |
| 50 | + |
| 51 | +### Preview Changes |
| 52 | + |
| 53 | +```bash |
| 54 | +# See what changes would be included without making modifications |
| 55 | +task preview-changes VERSION=0.8.0 |
| 56 | +``` |
| 57 | + |
| 58 | +### Clean Up |
| 59 | + |
| 60 | +```bash |
| 61 | +# Remove temporary files |
| 62 | +task clean-temp |
| 63 | +``` |
| 64 | + |
| 65 | +### Help |
| 66 | + |
| 67 | +```bash |
| 68 | +# Show all available tasks and examples |
| 69 | +task help |
| 70 | +# or just |
| 71 | +task |
| 72 | +``` |
| 73 | + |
| 74 | +## What Gets Updated |
| 75 | + |
| 76 | +1. **CHANGELOG.md**: Adds a new version section with: |
| 77 | + - Date-stamped version header |
| 78 | + - Categorized changes (Added, Fixed, Dependencies) |
| 79 | + - PR numbers and links |
| 80 | + - List of contributors |
| 81 | + |
| 82 | +2. **plugin.xml**: Updates the `<change-notes>` section with: |
| 83 | + - HTML-formatted list of key changes |
| 84 | + - Focuses on user-facing features and fixes |
| 85 | + - Limits dependency updates to avoid clutter |
| 86 | + |
| 87 | +## Customization |
| 88 | + |
| 89 | +The Taskfile can be customized by editing `Taskfile.yml`: |
| 90 | + |
| 91 | +- Modify PR categorization rules in the `jq` filters |
| 92 | +- Change the number of dependency updates shown in plugin.xml |
| 93 | +- Adjust the changelog format |
| 94 | +- Add additional tasks for related release processes |
| 95 | + |
| 96 | +## Manual Review |
| 97 | + |
| 98 | +After running the automation: |
| 99 | + |
| 100 | +1. **Review CHANGELOG.md** - Ensure categorization is correct and edit descriptions if needed |
| 101 | +2. **Review plugin.xml** - Make sure change-notes are user-friendly and properly formatted |
| 102 | +3. **Commit changes** - The automation doesn't commit, allowing you to review first |
| 103 | + |
| 104 | +## Troubleshooting |
| 105 | + |
| 106 | +- **"gh not found"**: Install GitHub CLI with `brew install gh` |
| 107 | +- **"jq not found"**: Install jq with `brew install jq` |
| 108 | +- **"No PRs found"**: Check if you're authenticated with `gh auth status` |
| 109 | +- **Permission issues**: Ensure you have read access to the repository |
0 commit comments