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.3

Options

How it works

  1. Checks that the git working tree is clean (unless --allow-dirty)
  2. Reads the current version from the version field in mix.exs
  3. Bumps the version according to the given level
  4. Reads release notes from RELEASE.md (required for stable releases, optional for pre-releases)
  5. 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
  6. Writes the bumped version back to mix.exs
  7. Writes the updated CHANGELOG.md
  8. Clears RELEASE.md for stable releases (major/minor/patch/stable)
  9. Stages mix.exs, CHANGELOG.md, and RELEASE.md with git add
  10. Creates a commit with the message "Version <version>"
  11. 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:

. 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.