mix hex.publish — Hex v2.0.6 (original) (raw)

View Source mix hex.publish (Hex v2.0.6)

Publishes a new version of the package.

$ mix hex.publish

The current authenticated user will be the package owner. Only package owners can publish the package, new owners can be added with themix hex.owner task.

Packages and documentation sizes are limited to 8mb compressed, and 64mb uncompressed.

publishing-documentation Publishing documentation

Documentation will be generated by running the mix docs task. ex_docprovides this task by default, but any library can be used. Or an alias can be used to extend the documentation generation. The expected result of the task is the generated documentation located in the doc/ directory with anindex.html file.

The documentation will be accessible at https://hexdocs.pm/my_package/1.0.0,https://hexdocs.pm/my_package will always redirect to the latest published version.

Documentation will be built and published automatically. To publish a package without documentation run mix hex.publish package or to only publish documentation run mix hex.publish docs.

reverting-a-package Reverting a package

A new package can be reverted or updated within 24 hours of it's initial publish, a new version of an existing package can be reverted or updated within one hour. Documentation have no limitations on when it can be updated.

To update the package simply run the mix hex.publish task again. To revert runmix hex.publish --revert VERSION or to only revert the documentation runmix hex.publish docs --revert VERSION.

If the last version is reverted, the package is removed.

command-line-options Command line options

configuration Configuration

dependencies Dependencies

Dependencies are defined in mix's dependency format. But instead of using:git or :path as the SCM :package is used.

defp deps() do
  [
    {:ecto, "~> 0.1.0"},
    {:postgrex, "~> 0.3.0"},
    {:cowboy, github: "extend/cowboy"}
  ]
end

As can be seen Hex package dependencies works alongside git dependencies. Important to note is that non-Hex dependencies will not be used during dependency resolution and neither will they be listed as dependencies of the package.

package-configuration Package configuration

Additional metadata of the package can optionally be defined, but it is very recommended to do so.