Asserts release-metadata consistency before publishing to Hex.
Catches the class of mistakes that precommit/quality.ci cannot see —
version/CHANGELOG/migration drift and unsafe git state — and exits non-zero
on any failure so it can gate mix hex.publish. It is the semantic core of
the mix prerelease alias and runs without a database.
Usage
$ mix phoenix_kit.release_check
$ mix phoenix_kit.release_check --allow-dirty --allow-branch
Options
--allow-dirty— downgrade the "working tree clean" check to a warning--allow-branch— downgrade the "on main branch" check to a warning
Checks Performed
- CHANGELOG Heading — top
## X.Y.Zentry matchesmix.exs@version(and is a real version, not "Unreleased"). - CHANGELOG Body — that entry has at least one content line.
- Migration Version Sync —
Migrations.Postgres.current_version/0equals the highestvNNN.exmigration file on disk. - Git Tree Clean — no uncommitted changes (
--allow-dirtyto warn). - Git Branch — on
main(--allow-branchto warn). - Tag Collision — tag
v<version>does not already exist (publish- before-tag means a pre-existing tag signals a double release).