|
| 1 | +# Release Process |
| 2 | + |
| 3 | +## Versioning |
| 4 | + |
| 5 | +worktreeflow follows [Semantic Versioning](https://semver.org/) (`MAJOR.MINOR.PATCH`). |
| 6 | + |
| 7 | +The **single source of truth** for the version is `pyproject.toml`. The Python package reads the version at runtime via `importlib.metadata`, so there is only one place to update. |
| 8 | + |
| 9 | +## Bump Version |
| 10 | + |
| 11 | +Use the Makefile targets to bump the version: |
| 12 | + |
| 13 | +```bash |
| 14 | +# Show current version |
| 15 | +make version |
| 16 | + |
| 17 | +# Bump patch (0.3.0 → 0.3.1) — bug fixes |
| 18 | +make bump-patch |
| 19 | + |
| 20 | +# Bump minor (0.3.0 → 0.4.0) — new features, backwards compatible |
| 21 | +make bump-minor |
| 22 | + |
| 23 | +# Bump major (0.3.0 → 1.0.0) — breaking changes |
| 24 | +make bump-major |
| 25 | +``` |
| 26 | + |
| 27 | +After bumping, run `uv sync` to refresh the editable install so `wtf version` reflects the new version. |
| 28 | + |
| 29 | +## Full Release |
| 30 | + |
| 31 | +The `make release` target automates: bump → sync → commit → tag. |
| 32 | + |
| 33 | +```bash |
| 34 | +# Patch release (default) |
| 35 | +make release |
| 36 | + |
| 37 | +# Minor release |
| 38 | +make release BUMP=minor |
| 39 | + |
| 40 | +# Major release |
| 41 | +make release BUMP=major |
| 42 | +``` |
| 43 | + |
| 44 | +This will: |
| 45 | +1. Bump the version in `pyproject.toml` |
| 46 | +2. Run `uv sync` to update the local install |
| 47 | +3. Commit the version change |
| 48 | +4. Create a git tag (e.g., `v0.4.0`) |
| 49 | + |
| 50 | +It does **not** push automatically. Review the commit and tag, then: |
| 51 | + |
| 52 | +```bash |
| 53 | +git push && git push --tags |
| 54 | +``` |
| 55 | + |
| 56 | +## Publishing to PyPI |
| 57 | + |
| 58 | +### Automated (Recommended) |
| 59 | + |
| 60 | +Publishing is handled by GitHub Actions. The workflow (`.github/workflows/publish.yml`) triggers when a **GitHub Release** is published: |
| 61 | + |
| 62 | +1. Push the version bump and tag (see above) |
| 63 | +2. Go to [GitHub Releases](https://github.com/smorinlabs/worktreeflow/releases) |
| 64 | +3. Click **Draft a new release** |
| 65 | +4. Select the tag you just pushed (e.g., `v0.4.0`) |
| 66 | +5. Add release notes |
| 67 | +6. Click **Publish release** |
| 68 | + |
| 69 | +The CI will automatically: |
| 70 | +- Run the test suite |
| 71 | +- Build the package with `uv build` |
| 72 | +- Publish to PyPI via OIDC (trusted publisher) |
| 73 | + |
| 74 | +### Manual |
| 75 | + |
| 76 | +If you need to publish manually: |
| 77 | + |
| 78 | +```bash |
| 79 | +uv build |
| 80 | +uv publish # requires PyPI API token |
| 81 | +``` |
| 82 | + |
| 83 | +## Pre-Release Checklist |
| 84 | + |
| 85 | +- [ ] All tests pass (`make test`) |
| 86 | +- [ ] Linting passes (`make lint`) |
| 87 | +- [ ] Type checking passes (`make typecheck`) |
| 88 | +- [ ] Version bumped (`make bump-patch` / `bump-minor` / `bump-major`) |
| 89 | +- [ ] `uv sync` run after bump |
| 90 | +- [ ] `wtf version` shows correct version |
| 91 | +- [ ] Changes committed and tagged (`make release`) |
| 92 | +- [ ] Pushed to remote (`git push && git push --tags`) |
| 93 | +- [ ] GitHub Release created |
0 commit comments