Skip to main content

Usage

Reads the built .facet archive from dist/, re-verifies it, and uploads it to the registry. Publish never builds on its own: facet build is the only producer of an archive. The credential is resolved first, then the source manifest is validated, then the archive is verified immediately before upload. The name and version addressing the upload come from the verified artifact, not from a separate read of the source manifest.

Examples

Exit codes

Output

Publish outcomes

Registry errors are shown verbatim.

Details

Drift

When the archive’s embedded manifest disagrees with the current source, publish distinguishes two cases and, in a terminal, asks what to do:
  • Missing artifact: offers to build the current source. Declining exits non-zero without contacting the registry.
  • Content drift: same name and version, different content. Rebuild and publish, or publish the existing artifact unchanged.
  • Identity drift: a different name or version. Build and publish current source, publish the existing artifact under its own name and version, or cancel.
Publishing an older artifact as is exists for a real workflow: you built v0.1.0 elsewhere, copied the archive here, and have since started editing facet.json for the next version. Without a terminal nothing is prompted. A missing artifact fails, and both drift classes warn on stderr and upload the existing artifact. For a strict rebuild, run facet build and facet publish as two commands. The decision semantics are specified in Publish.

Troubleshooting

Cause: a published name and version pair is immutable, so it cannot be republished with different content.Fix: bump the version, rebuild, and publish again:
Cause: dist/ holds no .facet archive. Without a terminal, publish will not build one for you.Fix: run facet build first, then publish.
Cause: dist/ holds more than one .facet, so publish cannot tell which one you meant.Fix: run facet build, which prunes dist/ and leaves exactly one archive, or delete the extras by hand.
Cause: the archive did not verify against its own integrity hashes and content rules immediately before upload. Nothing was sent to the registry.Fix: rebuild with facet build and publish the fresh artifact. If it keeps failing, the archive on disk was modified after it was built.
Cause: no credential was found, so publish stops before any verification or registry request.Fix: see facet login.

See also