# `Forecastle`
[🔗](https://github.com/ausimian/forecastle/blob/1.0.0/lib/forecastle.ex#L1)

Build-time integration for Castle-managed Elixir releases.

`steps/1` adds Forecastle's hooks to a Mix release. Most projects call it
through `Castle.customize/1`.

# `generate_relup`

```elixir
@spec generate_relup(Mix.Release.t()) :: Mix.Release.t()
```

Generates this release's relup, from the `:upgrade_from` release option.

`steps/1` places generation after release customisation and immediately before
`:tar`. An explicitly placed generator keeps its position. A project with a
custom packaging step must place generation after all release changes and
immediately before packaging.

`:upgrade_from` is a list of `rel:`, `tar:` or `ref:` baseline specs. The
function generates both upgrade and downgrade directions for each baseline
with the `auto` strategy. See `Forecastle.Baseline` for the grammar.

Omitting `:upgrade_from` skips generation. An empty value, a project-root
`relup` supplied with the option, or a change after `pre_assemble/1` is an
error. Use `mix castle.relup` for separate directions or the `--hot` and
`--restart` strategies.

# `post_assemble`

# `pre_assemble`

# `refuse_late_upgrade_from`

```elixir
@spec refuse_late_upgrade_from(Mix.Release.t()) :: Mix.Release.t()
```

Refuses a build whose `:upgrade_from` is not the one `pre_assemble/1` resolved.

`steps/1` places this check after all project steps. `generate_relup/1` also
checks before using the option. Define or compute baselines in `mix.exs`, or in
a step before `:assemble`, so `pre_assemble/1` can resolve them.

The function also rejects a release that names baselines after losing the
record left by `pre_assemble/1`. A custom step should update the option list it
receives instead of replacing the list.

# `steps`

```elixir
@spec steps(maybe_improper_list()) :: maybe_improper_list()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
