You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add smoother release workflow with bumpver (#23) (#28)
- Make version dynamic via hatchling regex source (single source of
truth: tidydraws/__init__.py), removing the literal version from
pyproject.toml so it can never drift
- Add bumpver config scoped to __init__.py with pre_commit_hook that
re-derives uv.lock into the same commit
- Add make release-patch/minor/major targets
- Add release.yml workflow: tag push creates GitHub Release with
auto-generated notes, which then triggers publish.yml
- Simplify publish.yml: removed fragile inline version assertion
- Add scripts/pre-bump.sh (uv lock + git add uv.lock)
- Add venv-*/ to .gitignore to prevent stray venvs breaking uv build
- Add Releasing section to CONTRIBUTING.md
- GitHub: enforce_admins off (admin direct-push for bumps), tag
protection ruleset (admin-only version tags), release environment
requires admin approval for PyPI upload
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,3 +136,43 @@ This repo ships the [Great Docs Agent Skills](https://posit-dev.github.io/great-
136
136
- Ensure all tests pass
137
137
- Add or update documentation as needed
138
138
- Keep changes focused and atomic
139
+
140
+
## Releasing
141
+
142
+
Releases are cut by a repo admin running a single `make` target. The version lives in one place — `tidydraws/__init__.py` (`__version__`) — and is read dynamically by hatchling at build time, so `pyproject.toml` never carries a version literal.
143
+
144
+
### To cut a release (admin only)
145
+
146
+
```bash
147
+
make release-patch # 0.4.0 -> 0.4.1
148
+
make release-minor # 0.4.0 -> 0.5.0
149
+
make release-major # 0.4.0 -> 1.0.0
150
+
```
151
+
152
+
This runs `bumpver`, which:
153
+
154
+
1. Bumps `__version__` in `tidydraws/__init__.py` (the only version literal in the repo).
155
+
2. Runs `scripts/pre-bump.sh`, which re-derives `uv.lock` and stages it so the lockfile lands in the same commit.
156
+
3. Commits with message `Bump version 0.4.0 -> 0.5.0`.
E --> F[PyPI upload — gated by release environment review]
168
+
```
169
+
170
+
The final PyPI upload runs in the `release`[environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment), which requires admin approval in the Actions UI. Nothing reaches PyPI without that click.
171
+
172
+
### Permissions and gating
173
+
174
+
-**Admin direct-push to `main`**: `enforce_admins` is off, so admins can push the bump commit directly. Non-admin collaborators still need a PR.
175
+
-**Tag protection**: only admins can push version tags (e.g. `0.5.0`), so only admins can trigger a release.
176
+
-**PyPI environment**: the `release` environment requires admin review before upload.
177
+
178
+
Non-admin collaborators and external contributors cannot cut releases at any stage.
0 commit comments