diff --git a/AGENTS.md b/AGENTS.md index 6194da0..5026274 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -246,7 +246,7 @@ The implementation lives in `dailybot_cli/commands/agent.py::_resolve_agent_cont - `feat:` → MINOR (e.g. `1.0.1 → 1.1.0`) - `fix:` / `perf:` → PATCH (e.g. `1.0.1 → 1.0.2`) - `feat!:` or `BREAKING CHANGE:` in the body → MAJOR (e.g. `1.0.1 → 2.0.0`) - - any other prefix or no prefix at all → PATCH (because `default_bump_level = 1` in `pyproject.toml`) + - any other prefix or no prefix at all → PATCH (because `default_bump_level = 2` in `pyproject.toml` — PSR 10's LevelBump value for PATCH) PSR then updates `pyproject.toml::version` + `CHANGELOG.md`, commits as `DailyBot Automations`, tags `vX.Y.Z`, and pushes. The tag push triggers `release.yml`, which fans out to PyPI, the Linux binary, the GitHub Release, and the Homebrew tap. - Do **NOT** hand-edit `pyproject.toml::version` or `CHANGELOG.md` for normal work — let the automation own them. The two fallback flows (manual `git tag`, local `twine`) are documented for emergencies. See [docs/RELEASE_AND_DISTRIBUTION.md](docs/RELEASE_AND_DISTRIBUTION.md). diff --git a/docs/RELEASE_AND_DISTRIBUTION.md b/docs/RELEASE_AND_DISTRIBUTION.md index 92c8d2b..42b57af 100644 --- a/docs/RELEASE_AND_DISTRIBUTION.md +++ b/docs/RELEASE_AND_DISTRIBUTION.md @@ -114,8 +114,8 @@ All version-bump behavior is configured in `pyproject.toml::[tool.semantic_relea - `version_toml = ["pyproject.toml:project.version"]` — single source of truth stays here - `tag_format = "v{version}"` — matches the existing `release.yml` trigger pattern - `commit_message = "chore(release): {version}\n\n[skip ci]"` — keeps the bump commit out of any future push-triggered jobs -- `allow_zero_version = true` + `major_on_zero = false` — `feat:` on `0.x` stays in `0.x.y`; we don't auto-jump to `1.0.0` until we explicitly land a `BREAKING CHANGE` -- `default_bump_level = 0` — if no `feat:` / `fix:` / `perf:` commits land in a PR, no release is cut (chore-only PRs are silent) +- `allow_zero_version = true` + `major_on_zero = true` — once the CLI went production-grade, breaking changes on a 0.x version DO promote to 1.0.0 (uniform semver) +- `default_bump_level = 2` — `chore:`/`docs:`/`refactor:` commits and unprefixed merges still cut a PATCH release (PSR 10 LevelBump: 0=NO_RELEASE, 1=PRERELEASE_REVISION, **2=PATCH**, 3=MINOR, 4=MAJOR). Setting this to `1` silently breaks releases — PSR will try to bump a non-prerelease tag with a prerelease level and fail with `Cannot increment a non-prerelease version with a prerelease level bump` ### Conventional commit cheat sheet diff --git a/pyproject.toml b/pyproject.toml index 8ea3ddf..2255e64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -203,8 +203,15 @@ patch_tags = ["fix", "perf"] # feat: → MINOR (1.0.1 → 1.1.0) # fix: / perf: → PATCH (1.0.1 → 1.0.2) # feat!: or BREAKING CHANGE: → MAJOR (1.0.1 → 2.0.0) -# anything else (chore/docs/...) → PATCH (default_bump_level = 1) -default_bump_level = 1 +# anything else (chore/docs/...) → PATCH (default_bump_level = 2) +# +# `default_bump_level` is a python-semantic-release LevelBump enum value. +# Under PSR 10.x: 0 = NO_RELEASE, 1 = PRERELEASE_REVISION, 2 = PATCH, +# 3 = MINOR, 4 = MAJOR. Setting this to 1 (as it was previously, a v9-era +# value where 1 meant PATCH) makes PSR try to cut a prerelease from a +# non-prerelease tag and fail with "Cannot increment a non-prerelease +# version with a prerelease level bump". +default_bump_level = 2 [tool.semantic_release.changelog] exclude_commit_patterns = [