Orchestrate a single-target Burrito build, archive, and checksum.
A single run/2 call is what one CI matrix entry does: resolve the
tinfoil target to the user's Burrito name, run mix release with
BURRITO_TARGET set, then locate the binary, tar.gz it, and write
a sha256 sidecar.
This module is the heart of tinfoil's tool-in-the-loop story: the
generated workflow calls mix tinfoil.build --target <atom> once
per matrix entry instead of embedding the packaging logic in bash,
so upgrading tinfoil upgrades the pipeline.
Summary
Types
@type opts() :: [ target: Tinfoil.Target.target(), skip_release: boolean(), output_dir: Path.t() ]
Functions
@spec run(Tinfoil.Config.t(), opts()) :: result()
Build a single target end-to-end.
Steps:
- Look up the user's Burrito target name for the tinfoil target.
- Unless
:skip_releaseis set, exportBURRITO_TARGETand runmix releasein the current project. - Locate
burrito_out/<app>_<burrito_name>and tar.gz it into the output directory with the configured archive basename. - Write a
.sha256sidecar next to the archive.
Returns a map describing what was produced.
@spec validate_tag_version( String.t(), keyword() ) :: :ok | {:skip, String.t()} | {:error, String.t()}
Check that the release tag matches the given version.
The tag comes from opts[:tag] if given, otherwise from the
GITHUB_REF_NAME environment variable. Explicit beats env, matching
how Tinfoil.Publish, Tinfoil.Homebrew, and Tinfoil.Scoop resolve
the tag.
Returns:
:ok— no tag available, or the tag matches{:skip, message}— the tag is not version-shaped, so there is nothing meaningful to compare. Callers should warn and continue.{:error, message}— a real mismatch