Publishes the package to hex.pm with pre-flight checks and version management.
Usage
mix publish # Full publish workflow
mix publish --dry-run # Run checks and build, but don't publish
mix publish --skip-checks # Skip pre-flight checks
mix publish --revert # Revert current version from hex.pm
mix publish --republish # Revert and republish in one stepPre-flight Checks
- Hex authentication - verifies you're logged in to hex.pm
- Git status - warns if uncommitted changes exist
- Tests - runs
mix testand aborts on failure - Credo - runs
mix credoand prompts to continue if issues are found - Version check - compares local version with hex.pm
If the local version matches the published version, you'll be prompted to bump the version (patch/minor/major/custom).
Post-publish
After successful publish, creates a git tag (e.g., v1.0.1) and optionally pushes it to the remote.
Revert and Republish
Hex.pm allows reverting a published version within 1 hour of publication.
The --revert flag reverts the current version from hex.pm.
The --republish flag combines revert + republish in one step, useful for
last-minute fixes without bumping the version number.
Time-based warnings are displayed:
- No warning if plenty of time remains (> 10 minutes)
- Yellow warning when < 10 minutes remain
- Red warning if the 1-hour window has expired (operation will likely fail)
On republish, the git tag is replaced (deleted locally and remotely, then recreated).