mix_release

Assembles a Mix release from a compiled mix_project.

Description#

mix_release depends on exactly one target that provides mix_project. It stages the project manifest, lockfile, configuration, declared data and tools, the compiled project environment, and separately cached dependency applications into an isolated project.

Optional pre_tasks run as ordered, exact task argument vectors before release assembly. The release task runs with compilation and dependency checks disabled, so it consumes the graph outputs instead of rebuilding them. The assembled release is cacheable by default.

Release artifacts are specific to the host operating system and processor architecture used to assemble them. The release uses the mix_env selected by its mix_project dependency. Use a production-environment project when the artifact is intended for deployment.

Attributes#

AttributeTypeRequiredDefaultDescription
manifeststringnomix.exsPackage-relative Mix project manifest
lockfilestringnomix.lockPackage-relative lockfile staged when present
release_namestringnoemptyConfigured release name; the project default is used when omitted
pre_taskslist<list<string>>no[]Ordered Mix tasks and their exact arguments run before assembly
release_argslist<string>no[]Additional arguments passed to mix release
configlist<string>no["config/**/*.exs"]Configuration files staged into the isolated project
config_fileslist<string>no[]Additional configuration files
datalist<string>no[]Project files available to pre-release tasks and assembly
toolslist<string>no[]Executable or support files available to pre-release tasks
os_envmap<string, string>no{}Environment values exported during assembly
env_inheritlist<string>no[]Host environment names inherited by the action
envmap<string, string>no{}Explicit environment values exported during assembly
cacheableboolnotrueWhether a successful release can be restored from the action cache

Dependency Edges#

EdgeAcceptsDescription
depsmix_projectExactly one compiled first-party Mix project

Providers#

The target emits mix_release with the assembled release_dir, release log, warning log, application name, and affected inputs.

Capabilities#

CapabilityOutput groups
builddefault, release

Example#

toml
[[target]]
name = "application_prod"
kind = "mix_project"
srcs = ["lib/**/*"]
deps = ["./dependencies_prod"]
[target.attrs]
app_name = "greeting"
mix_env = "prod"
[[target]]
name = "release"
kind = "mix_release"
srcs = ["mix.exs"]
deps = ["./application_prod"]
[target.attrs]
manifest = "mix.exs"
config = ["config/**/*.exs"]
pre_tasks = [
["assets.deploy"],
]

Sources#

  • Mix releases documents release naming, configuration, assembly, and runtime behavior.