Releaser.Publisher (releaser v0.0.4)

Copy Markdown View Source

Orchestrates publishing multiple apps to Hex in topological order.

For each app (in dependency order):

  1. Backs up the original mix.exs
  2. Replaces path: deps with their published Hex versions (~> X.Y)
  3. Injects package/0 metadata if missing
  4. Runs mix hex.publish --yes
  5. Restores the original mix.exs (always, even on failure)

Summary

Functions

Executes the publish flow.

Plans the publish order and returns a list of levels with app info.

Restores backed-up mix.exs files.

Functions

ensure_package_config(content, pkg_defaults)

execute(opts \\ [])

Executes the publish flow.

plan(opts \\ [])

Plans the publish order and returns a list of levels with app info.

Does not modify anything. Filters out apps whose local version is already on Hex (status == :published), so publish is idempotent.

Returns a map with:

  • :levels — topological levels after filtering (only apps that need publishing)
  • :apps — publishable apps with cleaned internal deps
  • :graph — dep graph
  • :skipped — apps filtered out because they're already on Hex (or pre-release). Each entry is %{app: name, local: v, hex: v, reason: :already_published | :prerelease}.

replace_path_dep(content, dep_name, dep_version)

restore(backups)

Restores backed-up mix.exs files.