Build a structured plan describing what tinfoil would build and release from the current config.
The plan is the shared data structure between mix tinfoil.plan
(human output), the GitHub Actions build matrix (JSON output), and
future mix tinfoil.build / mix tinfoil.publish tasks.
This module is deliberately pure — no filesystem, no network, no
shelling out — so it is trivial to test and safe to call from any
context. The companion mix tinfoil.plan task layers in side
effects on top: pretty-printing for humans, and NIF cross-compile
warnings via Tinfoil.NifCheck.
Summary
Functions
Build a plan map from a resolved %Tinfoil.Config{}.
Return the list of build job matrix entries.
Return the GitHub Actions matrix fragment — an object with an
include array, one entry per target.
Types
Functions
@spec build(Tinfoil.Config.t()) :: t()
Build a plan map from a resolved %Tinfoil.Config{}.
The :targets list preserves the order the user configured.
@spec build_entries(t()) :: [build_entry()]
Return the list of build job matrix entries.
In the default (single_runner_per_os: false) mode every tinfoil
target is its own entry, so the CI matrix is one job per target.
When :single_runner_per_os is true, targets that share both a
runner and an OS family are collapsed into a single entry. The
:targets field is a comma-separated list of tinfoil target names
that the generated workflow loops over with a shell for.
@spec matrix(t()) :: %{include: [target_plan()]}
Return the GitHub Actions matrix fragment — an object with an
include array, one entry per target.
Suitable for feeding into strategy.matrix via fromJson():
- id: plan
run: echo "matrix=$(mix tinfoil.plan --format matrix)" >> $GITHUB_OUTPUT
build:
needs: plan
strategy:
matrix: ${{ fromJson(needs.plan.outputs.matrix) }}