horizechCLI
Workspace commands (hws)latest · 0.1.2

hws publish

Check the registry, build, zip and upload a new version.

hws publish [dir] [--org <slug>] [--channel dev|beta|stable]
            [--notes <text>] [--create [--visibility private|public]]
            [--dry-run] [--no-build] [--json]

Also available as horizech hws publish.

Before building, publish checks everything it can against the registry, so a mistake costs a second instead of a build:

  1. Reads and checks package.hws. A theme cannot be published (the registry has no theme type); hws pack still makes its zip.
  2. Finds the organization: --org, or the one organization you can see that has a package with this Code.
  3. Checks the package exists there. If it does not, publish stops and points you at --create.
  4. Checks the package's type matches Info.Type, which catches a wrong Code.
  5. Checks you are OWNER or ADMIN of the organization.
  6. Checks the version is not already in the channel. Bump Version in package.hws if it is.
  7. Builds and zips exactly as hws pack does, creates the package if --create was given, and uploads.
The channel is always sent. It defaults to dev. Move a version on with hws promote once it has been tested.

--dry-run works signed out too: it then skips the registry checks and says so.

Arguments

ArgumentDescriptionDefault
dirThe component folder.the current folder

Options

OptionDescriptionDefault
--org <slug>The organization that owns the package. Required with --create.found from the package code
--channel <channel>dev, beta or stable.dev
--notes <text>Release notes stored with the version.
--createCreate the package in --org if it does not exist yet.
--visibility <v>private or public for a package made by --create. Only valid with --create.private
--dry-runRun every check and the build, list the zip's contents, and stop before creating or uploading anything.
--no-buildZip existing build output instead of building (see hws pack).
--jsonPrint a machine-readable result on stdout. Progress goes to stderr.

Examples

See what would be published

$ hws publish --dry-run

Publish to dev

$ hws publish --org acme --notes "Fixes the export button"

First publish of a new package

$ hws publish --org acme --create

CI: publish what an earlier step built

$ hws publish --org acme --no-build --json

With --json

stdout
{
  "dryRun": false,
  "org": "acme",
  "code": "HWS_APP_NOTES",
  "version": "1.4.0",
  "channel": "dev",
  "createdPackage": false,
  "registryChecked": true,
  "size": 1048576,
  "sha256": "ae3c0da7…",
  "entries": [ … ],
  "published": { "Id": "…", "Version": "1.4.0", "Channel": "dev", "FileHash": "ae3c0da7…" }
}

API calls

What this command calls, for debugging and for anyone scripting the same thing. Registry paths are on https://api.horizech.com, OAuth2 paths on https://horizech.com. See Registry API.

MethodPathNotes
GET/api/v1/packages?search=<CODE>only when --org is left out
GET/api/v1/packages/:org/:codeexists, type, your role
GET/api/v1/packages/:org/:code/versions/:version/manifest?channel=…already published?
POST/api/v1/packagesonly with --create
POST/api/v1/packages/publishmultipart: OrganizationSlug, Code, Channel, Manifest, File, ReleaseNotes