Publisho
Version management for Elixir projects. Bump versions, update changelogs, commit, and tag — all in one command.
Usage
mix publisho patch # 1.2.3 -> 1.2.4
mix publisho minor # 1.2.3 -> 1.3.0
mix publisho major # 1.2.3 -> 2.0.0
mix publisho rc # 1.2.3 -> 1.2.4-rc.1
mix publisho beta # 1.2.3 -> 1.2.4-beta.1
mix publisho alpha # 1.2.3 -> 1.2.4-alpha.1
mix publisho stable # 1.2.3-rc.1 -> 1.2.3Options
--dry-run— show what would happen without making changes--as-major— bump major when entering pre-release (alpha/beta/rc only)--as-minor— bump minor when entering pre-release (alpha/beta/rc only)--allow-dirty— skip the git clean check
How it works
-
Checks that the git working tree is clean (unless
--allow-dirty) -
Reads the current version from the
versionfield inmix.exs - Bumps the version according to the given level
-
Reads release notes from
RELEASE.md(required for stable releases, optional for pre-releases) -
Updates
CHANGELOG.md— if an entry for the same base version already exists (e.g. a previous RC), it is replaced in-place; otherwise a new entry is inserted after the placeholder -
Writes the bumped version back to
mix.exs -
Writes the updated
CHANGELOG.md -
Clears
RELEASE.mdfor stable releases (major/minor/patch/stable) -
Stages
mix.exs,CHANGELOG.md, andRELEASE.mdwithgit add -
Creates a commit with the message
"Version <version>" - Creates an annotated git tag using the version string, with the release notes as the tag annotation (falls back to the version string if empty)
With --dry-run, steps 1-5 execute (pure computation) and the remaining steps are printed but not performed.
Setup
Your project needs two files:
RELEASE.md— write your release notes here before running the task. For stable releases this file is required and must not be empty. For pre-releases it is optional; if absent or empty, the version string is used as the tag annotation.
. Entries are inserted after this line. ```markdown # Changelog <!-- %% CHANGELOG_ENTRIES %% --> ``` ## Installation Addpublishoto your list of dependencies inmix.exs`:
elixir def deps do [ {:publisho, "~> 0.1.0", only: :dev, runtime: false} ] end
Documentation is available at HexDocs.