Publishing
Publishing a workspace means turning pending changelog
fragments into version bumps, recording what shipped as git
tags, and pushing packages to Hex in dependency order with workspace path
dependencies rewritten to Hex requirements. To retry publication, use the
same approved release commit: publish skips versions already on Hex, and
tag create reconciles existing tags and releases.
trellis release pr [--base <branch>] [--branch <branch>] [--pre <label|none>] [--set <pkg=version>] [--bump <pkg=level>] [--resume] [--auto-pre] [--skip-unchanged] [--prepare-command <command>] [--json | --github-output]trellis tag plan [--json] [--force=adopt]trellis tag create [--push] [--github-release] [--force=adopt]trellis publish <pkg | --tag <tag> | --all-untagged> [--dry-run]trellis lockfile refresh [--package <pkg>]Tag format, path-dep rewriting, and Hex retry policy are configured under
[tools.trellis.publish]:
[tools.trellis.publish]exact_tag_format = "{name}-v{version}" # lat_core-v1.2.0series_tag_format = "{name}-v{series}" # lat_core-v1.2, lat_cli-v0.4# Which tags a release maintains, one entry per tag. "exact" keeps the whole# version and is immutable; "major" (v1) and "minor" (v1.2) truncate it and# move. Default ["exact"].package_tags = ["exact"]# Per-package overrides, keyed by a member-path glob.package_tags_overrides = { "packages/lat_cli" = ["exact", "major", "minor"] }# How a path dep is rewritten to a Hex requirement at publish time, from the# dependency's current version X.Y.Z:# minor → ">= X.Y.Z and < (X+1).0.0" (default)# patch → ">= X.Y.Z and < X.(Y+1).0"# exact → "== X.Y.Z"path_dep_requirement = "minor"retry = { attempts = 5, initial_delay = "30s", multiplier = 2 }
repository_tag_package = "lat_cli" # anchor packagerepository_tag_format = "repo-v{series}" # repo-v0.4# All three repository keys are required together, or omitted together.repository_tags = ["major", "minor"] # repo-v0 and repo-v0.4The release PR
Section titled “The release PR”trellis release pr turns pending fragments into a release pull request: it
runs version apply on a release branch (default release/pending), commits
the bumps, replaces the remote branch with a force-with-lease
check, and
creates or updates the PR via the GitHub API. It needs a token: GITHUB_TOKEN
(ambient in GitHub Actions), GH_TOKEN, or a logged-in gh CLI as the
fallback (gh auth token). The body includes the bump table
and each package’s new CHANGELOG section. It requires a clean working tree
and is a no-op when there is no eligible release plan.
After updating an existing PR’s branch, trellis checks that GitHub reports the pushed commit before it updates the PR description. If GitHub still reports the previous head, trellis makes up to six checks, one second apart. A closed or retargeted PR, a changed PR identity, or an unexpected head stops preparation without further retries. If PR finalization fails after the push, the error states that the branch was pushed but finalization remains incomplete. No structured success output is emitted; check the remote branch and PR before retrying.
Release titles
Section titled “Release titles”Set release.title_format in the workspace configuration to use a commit type
that your repository’s title checks accept:
[tools.trellis.release]title_format = "chore: release {summary}"The default is release: {summary}. The same format supplies the release
commit message and the title of both new and updated PRs. Trellis reads it from
the selected base branch, not the caller’s branch.
{summary} is the only placeholder. It expands to the comma-separated
package names and proposed versions, including prerelease labels; for example,
lat_core v1.3.0-rc.0, lat_mid v0.5.1-rc.0. All other text is literal.
The format must contain {summary} and must be a single line without control
characters. Changing the format on the base branch refreshes a pending PR even
with --skip-unchanged, while preserving its proposed versions with --resume.
Candidates and promotion
Section titled “Candidates and promotion”release pr accepts the same repeatable --set and --bump, plus --pre,
as version plan and version apply. Use one release
branch and one open PR for the whole cycle:
# Choose the stable target and candidate label: 1.3.0-rc.0.trellis release pr --set lat_core=1.3.0 --pre rc# After merging and publishing that PR, prepare 1.3.0-rc.1.trellis release pr --pre rc# After the last candidate merges and publishes, prepare stable promotion.trellis release pr --pre noneEach request regenerates from the selected base, not the old release branch.
Retrying against an unchanged base produces the same candidate version; the
next candidate follows a merge. This is version repeatability, not a promise
of identical commit hashes or rendering dates. On a prerelease base, choose a
label or --pre none instead of relying on the
default stable bump. The opt-ins below let automated callers retain that choice.
Candidate fragments move from unreleased/ into source archives beside the
candidate’s Markdown section. Later candidates include only new fragments;
stable promotion rolls up the target’s archives and any new fragments.
Review and merge each PR before publishing;
never publish an unmerged candidate branch.
The Gleam/Hex workflow handles manual requests, pauses automatic preparation during this cycle, and publishes only the approved merge commit. It blocks new preparation until publication and tagging of the previous merged release succeed, then restores automatic stable preparation after a published promotion.
Resuming a pending request
Section titled “Resuming a pending request”Use --resume to keep the package versions proposed by a pending PR, including
candidate versions and stable promotion targets:
trellis release pr --pre rc --set lat_core=2.0.0 --set lat_mid=1.0.0# A later push keeps those targets and the pending rc.0 versions.trellis release pr --resume --skip-unchangedThe pending PR’s manifests supply the targets. New fragments update its release
notes without changing those targets, even when the versions were originally
derived from fragment kinds rather than explicit --set options. Review the
targets when new breaking changes arrive. Packages joining the release use the
normal plan and the pending candidate label or promotion mode.
No release-intent file is needed. Preparation removes an existing
<changelog.dir>/release.toml from the generated release commit. Candidate
fragment archives remain unchanged.
Explicit package options replace matching stable targets. Package overrides
take precedence over a workspace-wide bump. An explicit workspace-wide
--bump recalculates inherited targets, subject to the candidate-series guard.
Once a candidate is proposed, its package stays in that version series, even
before the PR merges. 1.3.0-rc.0 can advance to 1.3.0-rc.1 or promote to
1.3.0, but cannot switch to 1.4.0-rc.0 or 2.0.0-rc.0.
--pre none replaces the candidate mode, removes inherited
overrides for packages already in a candidate cycle, and retains targets for
stable packages joining the promotion. Explicit contradictory promotion
overrides still fail.
Trellis finds only open, same-repository PRs with the requested head and base.
Fork PRs cannot supply targets. Multiple matches, a different pending base,
invalid or backward proposed versions, moved packages, changed source versions,
and already-merged pending heads produce errors before replacement. Trellis uses
the PR’s common ancestor with the selected base to check source versions and
release inputs; fetch full history if that ancestor is unavailable.
Use --no-resume with explicit release options to replace the proposed targets.
If the pending PR cannot be validated, also use --no-skip-unchanged.
Automatic candidate preparation
Section titled “Automatic candidate preparation”Use --auto-pre after a candidate merges. Mode precedence is explicit
--pre, then the mode read from pending versions with --resume, then the committed candidate
label, then the existing stable default. No automatic path promotes to stable.
A pending PR must be resumed or replaced with an explicit mode; automation
does not replace its proposed versions with a new automatic request.
trellis release pr --resume --auto-pre --skip-unchangedCandidates keep their separate stable version bases. Stable packages joining
the cycle use the normal fragment plan. Conflicting labels name the affected
packages in an error; select --pre <label> explicitly to resolve them.
--auto-pre always checks for new release content. --skip-unchanged enables
the same check for explicit preparation and resumed requests. Unrelated docs,
excluded examples/benchmarks, generated changelogs, and historical archives do
not trigger another candidate. Added, edited, and deleted unreleased fragments,
package src/, priv/, manifests, and release configuration do. Bundled
workspace sources count for their release owners. A stable owner with changed
sources but no release plan needs a fragment.
Deleting all content from a pending release without leaving a valid replacement
plan is an error, not a successful no-op. Promotion is never blocked merely
because candidate content is unchanged. A new stable target or candidate label is a changed
request. To deliberately prepare another otherwise-unchanged candidate, use
--force; validation still applies. Explicit --pre without content skipping
keeps the existing behavior.
Trellis inspects parsed manifest history and verifies the candidate’s release
section, separately for each package. Missing or inconsistent history fails:
fetch full history or make an explicit --pre preparation to establish a new
baseline. Retained legacy fragments alone cannot generate an endless candidate
cycle.
These options also have false-by-default
release configuration keys.
--no-resume, --no-auto-pre, and --no-skip-unchanged override configured
values. Disabling configured skipping does not disable the automatic mode’s
guard; use --force for that.
CI outcomes
Section titled “CI outcomes”--json emits trellis.release_pr/1; --github-output emits single-line
key=value records like ci outputs. They are mutually exclusive and keep
stdout free of progress text and update notices.
outcome |
Meaning |
|---|---|
prepared |
The release branch and PR were created or updated successfully. pr_action is created or updated. |
unchanged |
No commit, push, or PR mutation was needed. With --prepare-command, generated files were also validated. |
no_changes |
No eligible release plan exists. |
Both forms include base, branch, and bumped, with the same fields as
version plan. PR identity (pr_number, pr_url) is present when known.
pr_action is present only for preparation. Optional fields are absent in JSON
and empty in GitHub output. An unchanged result’s plan was evaluated, not
applied during this run. Errors remain nonzero and do not emit a successful result.
Generating and validating release files
Section titled “Generating and validating release files”Use --prepare-command when generated files depend on the proposed versions.
Trellis runs the command with sh -c at the workspace root after applying
versions and before staging, committing, or pushing. Generated files and
standalone consumer locks enter the same commit as the version changes.
The command’s stdout and stderr go to stderr, including with --json or
--github-output.
Define an idempotent command in your repository that refreshes the required
files and then checks them. In this example, just prepare-release is a
caller-defined recipe, not a built-in trellis task:
- name: Prepare the release id: release run: >- trellis release pr --resume --auto-pre --skip-unchanged --prepare-command 'just prepare-release' --github-output >> "$GITHUB_OUTPUT"With --skip-unchanged or the automatic candidate guard, unchanged native
release inputs do not skip this command. Trellis validates the selected
pending PR head without reapplying versions. If generation changes its files,
trellis commits the repairs on that head and updates the same PR with a
prepared outcome. This repairs older partial preparations too. A clean rerun
returns unchanged without changing the branch or PR. The initial remote SHA
remains the push lease; concurrent branch or PR changes cause an error.
When an unchanged candidate is already merged and has no pending PR, the
command validates the current base. Generated changes cause an error: resolve
the local changes, then use --force to prepare a new release deliberately.
The command does not run for no_changes.
Only run trusted generation and validation commands. Do not commit, switch branches, push, tag, publish, or change package versions in the command. Trellis stages all non-ignored changes after it succeeds; staging inside the command is not required. A nonzero exit or start failure stops trellis before its commit, push, or PR mutation and reports an error, not a successful outcome. Local changes remain for inspection. Trellis restores the caller’s branch when possible and reports a restoration failure if those changes prevent it. Commit or remove those local changes before retrying.
Custom workflows must still serialize preparation and wait for the prior merged release’s required publication and tagging. These flags do not change Hex policy or authorize publication.
tag plan lists the tags the current versions call for and don’t have yet.
tag create reconciles them in topological order; --push pushes them, and
--github-release (which implies --push and needs the same GitHub token
as release pr) also creates a GitHub Release per exact tag, with the
matching CHANGELOG section as the body. --dry-run reports every tag, push,
and release it would perform without doing any of them.
Each entry in a package’s package_tags falls into one of two lifecycles:
- Exact tags (
{name}-v{version}) are immutable. They are created once, fetched when origin already has them, and never rewritten. Local and remote disagreeing about what one names is an error, not something to reconcile. - Series tags (
{name}-v{series}) move. Releasing a new version in the series force-moves its tag to the release commit and force-pushes it, so consumers can tracklat_cli-v0.4and follow the series instead of chasing patch tags.trellis pingives git-dependency consumers a reviewable way to do exactly that. The signal is the package’s manifest version stored at the tag, so a commit that does not release the package, such as another package’s release or a docs change, leaves its series tags alone. The series is derived from the version; see series tags. - Repository tags are independent of any package’s list. Trellis moves the configured tag only when the anchor package’s manifest version differs from the version at that tag. A series change creates a new tag and leaves the prior series tag intact.
$ trellis tag planlat_core: 1.2.0 needs tag lat_core-v1.2.0lat_cli: 0.4.3 needs tag lat_cli-v0.4.3lat_cli: 0.4.3 moves tag lat_cli-v0.4
$ trellis tag create --github-releasetagged lat_core-v1.2.0pushed lat_core-v1.2.0tagged lat_cli-v0.4.3pushed lat_cli-v0.4.3moved lat_cli-v0.4force-pushed lat_cli-v0.4--github-release creates releases only for immutable exact tags.
Moving series tags do not get GitHub Releases.
Prereleases use immutable exact tags such as lat_core-v1.3.0-rc.0 when
package_tags includes exact. Neither package nor repository moving series
tags advance during a candidate release. New GitHub releases for prerelease
manifest versions have prerelease: true; stable versions have it set to
false, regardless of custom tag spelling. Without --package, retrying skips
an existing published GitHub release rather than rewriting it. An existing
draft fails the command; finalize it with the package-specific flow below.
Published releases with recorded required assets are checked before being skipped.
When publish.primary_package is configured, retries also reconcile Latest
without rewriting release notes or assets.
If an older candidate release was
misclassified, its owner must correct its prerelease setting on GitHub.
With no exact entry a package has no per-version tags at all, so there is no
tag to trigger a publish from: run trellis publish --all-untagged on
release-PR merge instead. Passing a series tag to publish --tag is an error,
because it names a package but no particular version.
Repository tags identify repository snapshots rather than package
releases, so neither publish --tag nor ci tag-package resolves them.
Primary package releases
Section titled “Primary package releases”Set one package’s releases as the repository’s Latest, even when other packages publish afterward:
[tools.trellis.publish]primary_package = "lat_core"trellis doctor checks that this manifest package name belongs to a discovered,
releasable package with exact tags. A package excluded by @members, a
workspace-only package, or one with only moving tags is not valid. Exact tag
namespaces must not overlap with another releasable package’s exact tags;
exact_tag_format must contain exactly one {version}.
tag create --github-release and release bootstrap --github-release mark the
highest published stable primary version as Latest. Secondary releases do not
take Latest, regardless of their versions or publication order. An older
maintenance release of the primary does not replace a newer stable version.
Drafts and prereleases cannot be Latest. Build metadata does not affect version
precedence; equally ranked releases retain the current primary Latest, or use
the first tag in lexical order if neither is Latest.
Package-specific finalization and existing-release retries apply the same policy. A secondary-only run restores the highest eligible primary release even when the primary is unchanged or omitted from that run. If no published stable primary release exists, trellis reports that fact and does not promote a secondary. It does not create a missing primary release or clear an unrelated existing Latest. Draft-only staging leaves Latest unchanged.
GitHub API failures return a nonzero exit status. If publication succeeded but
the Latest update failed, retry the same command; the retry repairs Latest
without creating another release. --dry-run reports the policy without
writing releases or Latest.
Serialize GitHub Release publication across the repository. GitHub has no
atomic conditional Latest update, so concurrent publishers can race. Releases
made by other tools do not follow this setting. Historical primary releases
must match the current exact_tag_format; old tag formats are not inferred.
Without primary_package, GitHub’s existing Latest behavior is unchanged.
Hex publishing and moving repository tags are not affected.
Adopting legacy repository tags
Section titled “Adopting legacy repository tags”Use --force=adopt when a configured repository series tag, such as v1,
predates the anchor package’s manifest. Without this option, a missing
historical manifest stops planning and tag creation.
The tag must point to an ancestor of HEAD, and its history must never have
contained the anchor manifest at its current path. A deleted manifest does
not qualify. Trellis rejects shallow history because it cannot prove these
conditions; fetch complete history first, for example with
git fetch --unshallow origin.
Preview at the approved release commit before authorizing a move:
trellis tag plan --json --force=adopttrellis tag create --push --dry-run --force=adopt
# Execute only when the release and alias move are authorized.trellis tag create --push --force=adoptrelease bootstrap accepts the same option and uses the same checks.
adopt is the only supported force mode; bare --force is an error.
The option does not bypass malformed manifests, newer anchor versions,
exact-tag conflicts, or concurrent remote changes. It cannot be combined
with --package, which leaves moving tags unchanged.
Planning uses local tags. A push dry run also checks origin and may fetch objects, but does not change local or remote tags. Installing trellis or adding its configuration does not move an existing alias. After adoption, retry at the same release commit without the option: exact tags remain immutable, and unchanged anchor versions leave aliases in place.
Required assets and draft releases
Section titled “Required assets and draft releases”Stage a release as a draft when required files must be attached before it becomes visible. Generate and qualify the files in your build jobs first; trellis does not build binaries, generate SBOMs, or sign files.
Run at the qualified release commit, after required registry publication succeeds:
trellis tag create --github-release --package lat_core --draft \ --asset dist/gleam.cdx.json --asset dist/rust.cdx.json
# Publish only after every recorded required asset passes content verification.trellis tag create --github-release --package lat_core --finalize--package selects one releasable package with an exact tag. It is required for
--asset, --draft, and --finalize, even in a single-package workspace.
The package-specific flow pushes only that exact tag; it leaves package and
repository moving tags unchanged. A tag format that cannot distinguish the
selected package from another releasable package is an error.
New releases start as drafts. --draft leaves them unpublished; without it,
trellis uploads the supplied assets and finalizes the release in the same
command. --finalize makes that last step explicit and can run without local
files once uploads are complete. Notes come from the committed matching
changelog section, and the manifest version determines the prerelease flag.
Repeat --asset FILE for each required file. Paths are relative to the calling
directory; uploaded names are their basenames. Names must be unique, use at most
170 ASCII letters, digits, dots, underscores or hyphens, and not start with the
reserved trellis-upload- prefix. Missing files, directories, and duplicate
names fail before tag creation.
Trellis records the release revision and required asset names and SHA-256 hashes
in a hidden trellis.release_assets/1 comment in the release notes. Do not remove
that comment. Omitting
an asset on a later invocation does not remove its requirement. Matching uploads
are reused; missing or changed required assets block finalization. Older assets
without a GitHub digest are downloaded for verification.
Conflicting contents fail unless you pass --replace-assets with --asset.
Trellis uploads and verifies a replacement under a temporary name before
deleting the original, then renames it. A failed upload preserves the original.
A failed rename can leave the verified replacement under trellis-upload-…;
retry the same command to finish. Replacement is not an atomic asset swap.
An already published release cannot be made a draft by this command, so
changes to its assets remain visible while they run.
Upload and finalization failures return a nonzero exit status. Retry with the
same files and flags; an upload accepted before a lost response is verified
rather than duplicated. Repeated successful finalization is a no-op except for
Latest repair when publish.primary_package is configured. Serialize
operations for each release; do not upload, edit notes, or finalize concurrently
from another job or tool.
Both local and remote exact tags must identify the checked-out HEAD, and
the committed package version must match the workspace version. If the default
branch has advanced, check out the original qualified release SHA and retry
there, not at the new branch tip. This flow does not roll back registry
publication or move an immutable tag.
The GitHub token needs permission to write repository contents. GitHub can also
require workflow-write permission when the original revision’s workflow files
differ from the default branch. The Actions GITHUB_TOKEN cannot grant that
permission; use an appropriately scoped App or personal access token for that
recovery case.
Publishing to Hex
Section titled “Publishing to Hex”publish selects members whose release
lifecycle is hex. A named package
and --tag <tag> both refuse a workspace or git_only package, and
--all-untagged only ever considers hex members. In a
manifest adapter workspace, the command
is refused: adapter packages cannot use the hex lifecycle.
Without
source bundling, it runs these steps per
package, in dependency order:
- Idempotency check. One Hex API query; versions already published are skipped.
- Validation.
gleam format --check,gleam build --warnings-as-errors, andgleam test, run against the original manifest with path deps intact. - Path-dep rewrite. Computed from the graph, never hand-listed: each
workspace path dependency becomes the Hex requirement derived from that
dep’s current version, per
path_dep_requirement. The version map only ever holdshexmembers, so a path dependency on agit_onlyorworkspacemember needs explicit source bundling; otherwise the rewrite fails rather than publishing something Hex could never resolve. - Publish.
gleam publish --yes. - Restore. Trellis restores the original
gleam.tomlwhen publishing completes or returns an error.
Every Hex-touching step runs under the configured retry backoff policy.
# Publish the package a pushed tag points at:trellis publish --tag "$GITHUB_REF_NAME"
# Or publish everything whose version isn't on Hex yet, in one run:trellis publish --all-untagged
# See what would be published (and rewritten) without doing it:trellis publish --all-untagged --dry-run--tag lat_core-v1.2.0 resolves a pushed tag to its package and refuses to
publish if the tag version doesn’t match gleam.toml. --all-untagged
publishes everything not yet on Hex, enabling a single publish run per
release instead of one per tag.
Dev-only path deps to a non-hex package are left alone, because Hex doesn’t
ship dev dependencies. Without explicit source bundling, a regular
[dependencies] path dep to a package whose lifecycle is less capable than
its dependent’s refuses to publish, and
doctor catches that boundary on every PR; see Release
lifecycle.
Bundling private dependencies
Section titled “Bundling private dependencies”Use source bundling when a releasable package needs code from a workspace package that you do not want to publish on Hex. Hex bundles combine source into one publishing package. Git-only bundles retain repository paths and package identities.
Bundling copies source; it does not rewrite modules. Trellis does not
rename modules, add a package-name prefix, or rewrite imports. Module names
must be unique across the publishing package, its bundled dependencies, and
the other dependencies in a consumer’s build. Use distinct module paths,
such as lib_a/parser and lib_b/parser, rather than defining parser in
both packages. Different package names alone do not prevent module collisions.
[tools.trellis]members = ["packages/*"]
[tools.trellis.publish.bundle]lib_a = ["lib_b"]
[tools.trellis.publish.lifecycle.packages]"packages/lib_b" = "workspace"In packages/lib_a/gleam.toml, keep the normal path dependency:
[dependencies]lib_b = { path = "../lib_b" }The publish.bundle keys are exact releasable package names, not paths or
globs; owners must have lifecycle hex or git_only. For a Hex owner, list
each direct non-Hex runtime dependency. A selected package must
have lifecycle workspace or git_only; bundling does not change its lifecycle.
Trellis also includes its transitive non-Hex runtime path dependencies once,
but keeps Hex packages as external requirements. It does not include bundled
packages’ tests or dev dependencies in the combined Hex package.
For example, these workspace sources:
packages/lib_a/src/lib_a.gleampackages/lib_b/src/lib_b.gleampackages/lib_b/src/lib_b/parser.gleamproduce one package’s source tree:
src/lib_a.gleamsrc/lib_b.gleamsrc/lib_b/parser.gleamKeep import lib_b and import lib_b/parser unchanged. The published package
has lib_a’s name and version, with no runtime dependency entry for lib_b.
Consumers install lib_a without a separate lib_b Hex release.
For trellis publish lib_a, trellis creates a temporary package, combines the
source trees, removes bundled dependency entries, and adds their external
runtime requirements. It runs gleam format --check,
gleam build --warnings-as-errors, and gleam test in that directory before
publishing from it. It keeps the checkout’s source, manifests, and lockfiles
unchanged and removes the temporary package after success or failure.
Publisher tests can still use local dev-only path dependencies. Run the
bundled packages’ own tests through your normal workspace test task.
Check before publishing
Section titled “Check before publishing”Run the workspace tests and bundle checks before a release:
trellis run testtrellis doctortrellis publish lib_a --dry-rundoctor checks the combined source inventory and manifest without building
the package or creating a temporary package. Dry-run reports the bundled packages
and external requirements without running Gleam; it still queries Hex to
check whether the version already exists.
| Check | Conflicts it can detect |
|---|---|
trellis doctor |
File and module-name collisions inside each configured bundle, incompatible internal-module rules, and differing dependency or compiler requirements. |
trellis publish lib_a --dry-run |
The same preparation conflicts for the selected unpublished package. |
trellis publish lib_a |
Preparation conflicts plus errors from building and testing the combined package with its resolved dependencies before upload. |
Two independent publishers can each include the same module names without a
conflict in either package alone. A consumer that installs both, or installs
a bundled package alongside a separate release of its bundled dependency,
can still encounter a collision. Neither publisher’s doctor check can
predict that future dependency combination; the consumer’s build must check it.
Compatibility and release notes
Section titled “Compatibility and release notes”For Hex bundles, trellis preserves module names and imports, including native Erlang and
JavaScript source files and their local source helpers. It preserves
internal_modules rules, including each package’s defaults, and rejects
patterns that would make another package’s public modules internal.
It merges identical dependency requirements and promotes an identical
publisher dev dependency to runtime when needed. Differing version requirements
or compiler constraints require you to align the manifests first.
Bundled OTP application startup modules, priv directories, and runtime git
dependencies are not supported. Trellis merges erlang.extra_applications
but rejects references to removed bundled applications. Native code must not
rely on the bundled package’s former OTP application identity; trellis cannot
detect dynamic application-name references.
Write a changelog fragment for each releasable bundle owner affected by a change
in bundled code. changelog check includes direct and transitive bundled
changes in those packages’ checks. A workspace dependency still has no
independent release or changelog; a git_only dependency keeps its own rules.
Hex bundling publishes the dependency’s source in the Hex archive. Check that you can redistribute it and that the publishing package declares the required licences. Trellis includes attributed licence notices in a standard licence file.
Git-only bundles
Section titled “Git-only bundles”A git_only package can include a workspace dependency in its release
without giving that dependency an independent version, tag, or changelog:
[tools.trellis]members = ["packages/*"]
[tools.trellis.publish.bundle]lib_a = ["lib_b"]
[tools.trellis.publish.lifecycle]default = "git_only"packages = { "packages/lib_b" = "workspace" }Keep lib_b = { path = "../lib_b" } in packages/lib_a/gleam.toml.
List every direct workspace runtime dependency; independent git_only
and hex dependencies do not need to be listed. Selected dependencies also
include their transitive non-Hex runtime path dependencies.
Trellis validates workspace paths and dependency coverage, and
changelog check counts bundled changes against lib_a. It does not merge
source, rewrite manifests, or create a Git release artifact. Your workflow
must include the dependency directories at the paths the manifests require.
Hex combined-package restrictions on module collisions, runtime Git
dependencies, OTP startup modules, and priv directories do not apply to
these separate package trees. Build and test them through your workspace
tasks, and validate your release artifact separately.
trellis publish lib_a and trellis publish --tag lib_a-v1.0.0 reject a
Git-only owner. trellis publish --all-untagged skips it, including
prereleases. Bundling never changes a package’s lifecycle or enables Hex
publication.
Lockfiles
Section titled “Lockfiles”lockfile refresh --package <pkg> runs gleam deps download for one package
with retries. Omit --package to refresh the whole workspace. Refreshing fewer
packages reduces requests to Hex.
Tag before or after publishing
Section titled “Tag before or after publishing”Trellis supports both; the difference is policy, not tooling:
| Order | Flow |
|---|---|
| Tag, then publish | Release PR merges → tag create --push → each pushed tag triggers a workflow running publish --tag "$GITHUB_REF_NAME". |
| Publish, then tag | Release PR merges → publish --all-untagged (one run, topologically ordered) → tag create --push --github-release records what shipped. |
The CI recipes provide a copyable publish-then-tag workflow with candidate/promotion controls and recovery.