diff --git a/AGENTS.md b/AGENTS.md index 92eeb6b..e513dd0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -197,13 +197,33 @@ Run `make check` before every push. It runs: lint → format-check → typecheck ## Release -1. Bump version in `pyproject.toml`, `src/agentic_sidecar/__init__.py`, and `CHANGELOG.md` -2. Commit: `git commit -am "release: vX.Y.Z"` -3. Tag: create an annotated `vX.Y.Z` tag and use the latest `CHANGELOG.md` - release section as the tag description -4. Push: `git push origin main --tags` - -The `release-pypi.yml` workflow triggers on the tag push and publishes to -PyPI via Trusted Publishing (OIDC) — no API token/secret required, but the -`pypi` GitHub Environment must exist and be configured as a Trusted -Publisher on PyPI before the first release. +Two phases, split by the merge to `main` — bumping happens before, tagging +and releasing happen after: + +**1. Pre-release (on the feature branch, before merge):** Bump version in +`pyproject.toml`, `src/agentic_sidecar/__init__.py`, and `CHANGELOG.md` +(a dated release section under `[Unreleased]`). Commit as part of the +branch's normal history; goes in with the rest of the PR. + +**2. Release (on `main`, once that branch has merged):** plain `git`, no +`gh` CLI required. + +1. Pull the merge commit on `main`. +2. Tag: create an annotated `vX.Y.Z` tag pointing at the merge commit, + using the CHANGELOG's release section as the tag message: + `git tag -a vX.Y.Z -F --cleanup=verbatim`. + `--cleanup=verbatim` is required — git's default cleanup silently strips + lines starting with `#`, which would eat the CHANGELOG's `###` headers. +3. Push the tag: `git push origin vX.Y.Z`. + +That's the whole release: `release-pypi.yml` triggers on the tag push and +publishes to PyPI via Trusted Publishing (OIDC) — no API token/secret +required, but the `pypi` GitHub Environment must exist and be configured +as a Trusted Publisher on PyPI before the first release. + +Note this deliberately does not create a GitHub Release object (that's a +`gh`/API-only action, not a `git` one) — the tag alone is enough to +publish to PyPI, but it means the repo's Releases tab stays empty unless +someone creates one by hand later (GitHub UI: Releases → Draft a new +release → pick the existing tag). That's an accepted tradeoff here, not +an oversight.