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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,19 +205,26 @@ Co-authored-by: Name <email>
205
205
206
206
## Pull request checklist
207
207
208
+
- PR title: Conventional Commits format (CI-enforced by `pr-lint.yml`).
208
209
- Tests: added/updated; `pytest` passes.
209
210
- Lint/format: `ruff check .`, `black` pass.
210
-
- Docs: update `README.md`and any Django docs pages if behavior changes.
211
+
- Docs: update `README.md` if behavior changes.
211
212
- Templates: update `templates/` if generator output changes.
212
213
- No generated artifacts committed.
213
214
214
215
## Versioning and releases
215
216
216
-
- The library version is tracked in `pyproject.toml` (`project.version`). Use SemVer.
217
-
- Workflow:
218
-
- Contributors: branch off `main` (or `dev` if used) and open PRs.
219
-
- Maintainer (release): bump version, tag, and publish to PyPI.
220
-
- Tag on `main`: `git tag -a vX.Y.Z -m "Release vX.Y.Z" && git push --tags`.
217
+
- The version is tracked in `pyproject.toml` (`project.version`) and mirrored in `src/pythonnative/__init__.py` as `__version__`. Both files are updated automatically by [python-semantic-release](https://python-semantic-release.readthedocs.io/).
218
+
-**Automated release pipeline** (on every merge to `main`):
219
+
1.`python-semantic-release` scans Conventional Commit messages since the last tag.
220
+
2. It determines the next SemVer bump: `feat` → **minor**, `fix`/`perf` → **patch**, `BREAKING CHANGE` → **major** (minor while version < 1.0).
221
+
3. Version files are updated, `CHANGELOG.md` is generated, and a tagged release commit (`chore(release): vX.Y.Z`) is pushed.
222
+
4. A GitHub Release is created with auto-generated release notes and the built sdist/wheel attached.
223
+
5. When drafts are disabled, the package is also published to PyPI via Trusted Publishing.
224
+
-**Draft / published toggle**: the `DRAFT_RELEASE` variable at the top of `.github/workflows/release.yml` controls release mode. Set to `"true"` (the default) for draft GitHub Releases with PyPI publishing skipped; flip to `"false"` to publish releases and upload to PyPI immediately.
225
+
- Commit types that trigger a release: `feat` (minor), `fix` and `perf` (patch), `BREAKING CHANGE` (major). All other types (`build`, `chore`, `ci`, `docs`, `refactor`, `revert`, `style`, `test`) are recorded in the changelog but do **not** trigger a release on their own.
226
+
- Tag format: `v`-prefixed (e.g., `v0.4.0`).
227
+
- Manual version bumps are no longer needed — just merge PRs with valid Conventional Commit titles. For ad-hoc runs, use the workflow's **Run workflow** button (`workflow_dispatch`).
221
228
222
229
### Branch naming (suggested)
223
230
@@ -249,6 +256,13 @@ release/v0.2.0
249
256
hotfix/cli-regression
250
257
```
251
258
259
+
### CI
260
+
261
+
-**CI** (`ci.yml`): runs formatter, linter, type checker, and tests on every push and PR.
262
+
-**PR Lint** (`pr-lint.yml`): validates the PR title against Conventional Commits format (protects squash merges) and checks individual commit messages via commitlint (protects rebase merges). Recommended: add the **PR title** job as a required status check in branch-protection settings.
263
+
-**Release** (`release.yml`): runs on merge to `main`; computes version, generates changelog, tags, creates GitHub Release, and (when `DRAFT_RELEASE` is `"false"`) publishes to PyPI.
264
+
-**Docs** (`docs.yml`): deploys documentation to GitHub Pages on push to `main`.
265
+
252
266
## Security and provenance
253
267
254
268
- Avoid bundling secrets or credentials in templates or code.
0 commit comments