mix nbpr.releasable (NBPR v0.2.1)

Copy Markdown View Source

Diffs each package's mix.exs @version against the latest version published to the nbpr Hex organisation, returning the topo-sorted list of packages that need a fresh release tag.

mix nbpr.releasable [--json] [--root <path>]

Reads NBPR_READ_KEY from the environment for the Hex org API. Without it, the org-scoped lookups fail with HTTP 401 and the task aborts.

Topological order

Every :nbpr_* package depends on :nbpr, so when both bump in the same push, :nbpr is emitted first. Sibling deps declared via nbpr_dep(:nbpr_<x>, ...) are honoured: nbpr_tcpdump (which depends on nbpr_libpcap) lands after nbpr_libpcap in the output.

Output

Without flags: human-readable lines, one per releasable.

With --json: a JSON array; consumed by auto-release.yml.

[
  {"name":"nbpr","version":"0.1.0","tag":"nbpr-v0.1.0","hex_version":null},
  {"name":"nbpr_libpcap","version":"1.10.5","tag":"nbpr_libpcap-v1.10.5","hex_version":null}
]

Flags

  • --json — emit a JSON array
  • --root <path> — workspace root (defaults to current directory)

Summary

Functions

Computes the topo-sorted list of releasable packages.

Functions

compute(root, hex_lookup)

@spec compute(Path.t(), (String.t() ->
                     {:ok, String.t()} | :not_found | {:error, term()})) :: [
  %{
    name: String.t(),
    version: String.t(),
    tag: String.t(),
    hex_version: String.t() | nil,
    deps: [String.t()]
  }
]

Computes the topo-sorted list of releasable packages.

hex_lookup is a 1-arity function called with each package name; it must return {:ok, version} for an existing Hex package, :not_found if Hex doesn't know about the package, or {:error, reason} for transport failures (which abort the run).