|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document describes the automated release process for taskfile-help. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The release process is highly automated using GitHub Actions. When you push a version tag, GitHub Actions automatically: |
| 8 | + |
| 9 | +1. Builds the package |
| 10 | +2. Runs the full test suite |
| 11 | +3. Creates a GitHub release with built assets |
| 12 | +4. Publishes the package to PyPI |
| 13 | + |
| 14 | +## Release Workflow |
| 15 | + |
| 16 | +### 1. Prepare the Release |
| 17 | + |
| 18 | +First, bump the version and prepare the release: |
| 19 | + |
| 20 | +```bash |
| 21 | +# Bump version (patch, minor, or major) |
| 22 | +task version:bump minor |
| 23 | + |
| 24 | +# Prepare release (runs tests, updates CHANGELOG, commits changes) |
| 25 | +task release:build |
| 26 | +``` |
| 27 | + |
| 28 | +The `release:build` task will: |
| 29 | + |
| 30 | +- Verify working directory is clean |
| 31 | +- Check version has been bumped |
| 32 | +- Validate CHANGELOG has unreleased changes |
| 33 | +- Run full test suite |
| 34 | +- Update CHANGELOG with version and date |
| 35 | +- Commit release preparation |
| 36 | +- Build distribution packages |
| 37 | +- Show next steps |
| 38 | + |
| 39 | +### 2. Create and Push the Tag |
| 40 | + |
| 41 | +```bash |
| 42 | +task release:tag |
| 43 | +``` |
| 44 | + |
| 45 | +This creates a git tag for the current version and pushes it to GitHub, which triggers the automated release workflow. |
| 46 | + |
| 47 | +### 3. Monitor the Automated Release |
| 48 | + |
| 49 | +After pushing the tag, GitHub Actions automatically: |
| 50 | + |
| 51 | +1. **Builds the package** - Creates wheel and source distribution |
| 52 | +2. **Runs tests** - Ensures everything passes |
| 53 | +3. **Creates GitHub Release** - With release notes from CHANGELOG |
| 54 | +4. **Uploads assets** - Attaches built packages to the release |
| 55 | +5. **Publishes to PyPI** - Makes the package available via `pip install` |
| 56 | + |
| 57 | +Monitor progress at: [GitHub Actions](https://github.com/royw/taskfile_help/actions) |
| 58 | + |
| 59 | +## GitHub Actions Workflows |
| 60 | + |
| 61 | +### Release Workflow (`.github/workflows/release.yml`) |
| 62 | + |
| 63 | +Triggers on: Tag push (`v*`) |
| 64 | + |
| 65 | +Steps: |
| 66 | + |
| 67 | +- Checkout code with full history |
| 68 | +- Set up Python 3.13 |
| 69 | +- Install dependencies with uv |
| 70 | +- Run test suite |
| 71 | +- Build package |
| 72 | +- Extract version from tag |
| 73 | +- Extract release notes from CHANGELOG |
| 74 | +- Create GitHub release with assets |
| 75 | +- Trigger PyPI publish workflow |
| 76 | + |
| 77 | +### Publish Workflow (`.github/workflows/publish.yml`) |
| 78 | + |
| 79 | +Triggers on: GitHub release published |
| 80 | + |
| 81 | +Steps: |
| 82 | + |
| 83 | +- Build distribution packages |
| 84 | +- Publish to PyPI using trusted publishing |
| 85 | + |
| 86 | +## Manual Steps (If Needed) |
| 87 | + |
| 88 | +### Manual PyPI Upload |
| 89 | + |
| 90 | +If automatic PyPI publishing fails, you can manually upload: |
| 91 | + |
| 92 | +```bash |
| 93 | +# Upload to Test PyPI first |
| 94 | +task release:pypi-test |
| 95 | + |
| 96 | +# Then upload to production PyPI |
| 97 | +task release:pypi |
| 98 | +``` |
| 99 | + |
| 100 | +### Manual GitHub Release |
| 101 | + |
| 102 | +If you need to create a release manually: |
| 103 | + |
| 104 | +1. Go to [GitHub Releases](https://github.com/royw/taskfile_help/releases) |
| 105 | +2. Click "Draft a new release" |
| 106 | +3. Choose the tag |
| 107 | +4. Copy release notes from CHANGELOG.md |
| 108 | +5. Upload files from `dist/` directory |
| 109 | +6. Publish release |
| 110 | + |
| 111 | +## Version Numbering |
| 112 | + |
| 113 | +This project follows [Semantic Versioning](https://semver.org/): |
| 114 | + |
| 115 | +- **MAJOR** version for incompatible API changes |
| 116 | +- **MINOR** version for new functionality (backwards compatible) |
| 117 | +- **PATCH** version for bug fixes (backwards compatible) |
| 118 | + |
| 119 | +Use the version bump tasks: |
| 120 | + |
| 121 | +```bash |
| 122 | +task version:bump patch # 0.3.0 -> 0.3.1 |
| 123 | +task version:bump minor # 0.3.0 -> 0.4.0 |
| 124 | +task version:bump major # 0.3.0 -> 1.0.0 |
| 125 | +``` |
| 126 | + |
| 127 | +## CHANGELOG Management |
| 128 | + |
| 129 | +The CHANGELOG follows [Keep a Changelog](https://keepachangelog.com/) format. |
| 130 | + |
| 131 | +### During Development |
| 132 | + |
| 133 | +Changes are automatically added to the `[Unreleased]` section by the post-commit hook based on conventional commit types: |
| 134 | + |
| 135 | +- `feat:` → Added section |
| 136 | +- `fix:` → Fixed section |
| 137 | +- `docs:` → Changed section |
| 138 | +- `refactor:` → Changed section |
| 139 | +- `perf:` → Changed section |
| 140 | + |
| 141 | +### During Release |
| 142 | + |
| 143 | +The `release:build` task automatically: |
| 144 | + |
| 145 | +1. Moves `[Unreleased]` content to a new version section |
| 146 | +2. Adds the version number and date |
| 147 | +3. Creates a new empty `[Unreleased]` section for future changes |
| 148 | + |
| 149 | +## Troubleshooting |
| 150 | + |
| 151 | +### Release Build Fails |
| 152 | + |
| 153 | +If `task release:build` fails: |
| 154 | + |
| 155 | +- **Uncommitted changes**: Commit or stash changes first |
| 156 | +- **Version not bumped**: Run `task version:bump` |
| 157 | +- **Empty CHANGELOG**: Make commits with conventional commit types |
| 158 | +- **Tests failing**: Fix tests before releasing |
| 159 | + |
| 160 | +### GitHub Actions Fails |
| 161 | + |
| 162 | +If the GitHub Actions workflow fails: |
| 163 | + |
| 164 | +1. Check the [Actions tab](https://github.com/royw/taskfile_help/actions) |
| 165 | +2. Review the failed step logs |
| 166 | +3. Fix the issue locally |
| 167 | +4. Delete the tag: `git tag -d v0.3.1 && git push origin :refs/tags/v0.3.1` |
| 168 | +5. Re-run the release process |
| 169 | + |
| 170 | +### PyPI Publishing Fails |
| 171 | + |
| 172 | +If PyPI publishing fails: |
| 173 | + |
| 174 | +1. Check PyPI trusted publishing is configured |
| 175 | +2. Verify the package version doesn't already exist on PyPI |
| 176 | +3. Use manual upload: `task release:pypi` |
| 177 | + |
| 178 | +## Security |
| 179 | + |
| 180 | +### PyPI Trusted Publishing |
| 181 | + |
| 182 | +This project uses [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) for secure, token-free publishing: |
| 183 | + |
| 184 | +- No API tokens stored in GitHub secrets |
| 185 | +- GitHub Actions authenticates directly with PyPI |
| 186 | +- Configured in PyPI project settings |
| 187 | + |
| 188 | +### GitHub Permissions |
| 189 | + |
| 190 | +The release workflow requires: |
| 191 | + |
| 192 | +- `contents: write` - To create releases and upload assets |
| 193 | +- `id-token: write` - For PyPI trusted publishing |
| 194 | + |
| 195 | +## Best Practices |
| 196 | + |
| 197 | +1. **Always run tests** before releasing (`task make`) |
| 198 | +2. **Review CHANGELOG** before releasing |
| 199 | +3. **Use semantic versioning** appropriately |
| 200 | +4. **Monitor GitHub Actions** after pushing tags |
| 201 | +5. **Test in staging** when possible (Test PyPI) |
| 202 | +6. **Keep CHANGELOG updated** with meaningful commit messages |
| 203 | + |
| 204 | +## Quick Reference |
| 205 | + |
| 206 | +```bash |
| 207 | +# Complete release process |
| 208 | +task version:bump minor # Bump version |
| 209 | +task release:build # Prepare release |
| 210 | +task release:tag # Create tag (triggers automation) |
| 211 | + |
| 212 | +# Monitor |
| 213 | +# Visit: https://github.com/royw/taskfile_help/actions |
| 214 | + |
| 215 | +# Manual fallback (if needed) |
| 216 | +task release:pypi-test # Test PyPI upload |
| 217 | +task release:pypi # Production PyPI upload |
| 218 | +``` |
0 commit comments