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:
- Reads and checks
package.hws. A theme cannot be published (the registry has no theme type);hws packstill makes its zip. - Finds the organization:
--org, or the one organization you can see that has a package with thisCode. - Checks the package exists there. If it does not,
publishstops and points you at--create. - Checks the package's type matches
Info.Type, which catches a wrongCode. - Checks you are OWNER or ADMIN of the organization.
- Checks the version is not already in the channel. Bump
Versioninpackage.hwsif it is. - Builds and zips exactly as
hws packdoes, creates the package if--createwas 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
| Argument | Description | Default |
|---|---|---|
dir | The component folder. | the current folder |
Options
| Option | Description | Default |
|---|---|---|
--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. | |
--create | Create 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-run | Run every check and the build, list the zip's contents, and stop before creating or uploading anything. | |
--no-build | Zip existing build output instead of building (see hws pack). | |
--json | Print a machine-readable result on stdout. Progress goes to stderr. |
Examples
See what would be published
$ hws publish --dry-runPublish to dev
$ hws publish --org acme --notes "Fixes the export button"First publish of a new package
$ hws publish --org acme --createCI: publish what an earlier step built
$ hws publish --org acme --no-build --jsonWith --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.
| Method | Path | Notes |
|---|---|---|
GET | /api/v1/packages?search=<CODE> | only when --org is left out |
GET | /api/v1/packages/:org/:code | exists, type, your role |
GET | /api/v1/packages/:org/:code/versions/:version/manifest?channel=… | already published? |
POST | /api/v1/packages | only with --create |
POST | /api/v1/packages/publish | multipart: OrganizationSlug, Code, Channel, Manifest, File, ReleaseNotes |